mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
ISO8601d: Added (m,d,y) ctor
This commit is contained in:
parent
860a1de034
commit
5073921707
2 changed files with 16 additions and 0 deletions
|
@ -126,6 +126,21 @@ ISO8601d::ISO8601d (const time_t t)
|
|||
_date = t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ISO8601d::ISO8601d (const int m, const int d, const int y)
|
||||
{
|
||||
clear ();
|
||||
|
||||
// Error if not valid.
|
||||
struct tm t = {0};
|
||||
t.tm_isdst = -1; // Requests that mktime determine summer time effect.
|
||||
t.tm_mday = d;
|
||||
t.tm_mon = m - 1;
|
||||
t.tm_year = y - 1900;
|
||||
|
||||
_date = mktime (&t);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ISO8601d::~ISO8601d ()
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
|
||||
ISO8601d ();
|
||||
ISO8601d (time_t);
|
||||
ISO8601d (const int, const int, const int);
|
||||
~ISO8601d ();
|
||||
ISO8601d (const ISO8601d&); // Unimplemented
|
||||
ISO8601d& operator= (const ISO8601d&); // Unimplemented
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue