ISO8601d: Added ::dayOfYear

This commit is contained in:
Paul Beckingham 2015-09-26 14:24:33 -04:00
parent ac428e1f1a
commit 5ed0d13194
2 changed files with 8 additions and 0 deletions

View file

@ -961,6 +961,13 @@ int ISO8601d::dayOfWeek () const
return t->tm_wday;
}
////////////////////////////////////////////////////////////////////////////////
int ISO8601d::dayOfYear () const
{
struct tm* t = localtime (&_date);
return t->tm_yday + 1;
}
////////////////////////////////////////////////////////////////////////////////
void ISO8601p::clear ()
{

View file

@ -59,6 +59,7 @@ public:
int year () const;
int weekOfYear (int) const;
int dayOfWeek () const;
int dayOfYear () const;
private:
void clear ();