diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index df30ac7e7..c8c1631cb 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -906,6 +906,13 @@ int ISO8601d::length (const std::string& format) return len; } +//////////////////////////////////////////////////////////////////////////////// +int ISO8601d::month () const +{ + struct tm* t = localtime (&_date); + return t->tm_mon + 1; +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index d82a9895b..466e40d7e 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -53,6 +53,8 @@ public: static int length (const std::string&); + int month () const; + private: void clear (); bool parse_date_time (Nibbler&);