mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
ISO8601d: Added ::toMDY
This commit is contained in:
parent
da88eefe2b
commit
7a5025e64d
2 changed files with 12 additions and 0 deletions
|
@ -840,6 +840,16 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void ISO8601d::toMDY (int& m, int& d, int& y)
|
||||||
|
{
|
||||||
|
struct tm* t = localtime (&_date);
|
||||||
|
|
||||||
|
m = t->tm_mon + 1;
|
||||||
|
d = t->tm_mday;
|
||||||
|
y = t->tm_year + 1900;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ISO8601d ISO8601d::startOfDay () const
|
ISO8601d ISO8601d::startOfDay () const
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,6 +46,8 @@ public:
|
||||||
operator time_t () const;
|
operator time_t () const;
|
||||||
bool parse (const std::string&, std::string::size_type&, const std::string& format = "");
|
bool parse (const std::string&, std::string::size_type&, const std::string& format = "");
|
||||||
|
|
||||||
|
void toMDY (int&, int&, int&);
|
||||||
|
|
||||||
ISO8601d startOfDay () const;
|
ISO8601d startOfDay () const;
|
||||||
ISO8601d startOfWeek () const;
|
ISO8601d startOfWeek () const;
|
||||||
ISO8601d startOfMonth () const;
|
ISO8601d startOfMonth () const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue