diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 3985b34a7..ad98d530d 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -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 () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 9830c7177..8e585a2ed 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -59,6 +59,7 @@ public: int year () const; int weekOfYear (int) const; int dayOfWeek () const; + int dayOfYear () const; private: void clear ();