diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index e01df077b..b1ca9eedf 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -926,6 +926,13 @@ int ISO8601d::day () const return t->tm_mday; } +//////////////////////////////////////////////////////////////////////////////// +int ISO8601d::year () const +{ + struct tm* t = localtime (&_date); + return t->tm_year + 1900; +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 4e6e9a72d..3563bd5b8 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -56,6 +56,7 @@ public: int month () const; int week () const; int day () const; + int year () const; private: void clear ();