diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 7abb1b79d..b7f00aec2 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -840,6 +840,16 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start) return false; } +//////////////////////////////////////////////////////////////////////////////// +void ISO8601d::toMDY (int& m, int& d, int& y) +{ + struct tm* t = localtime (&_date); + + m = t->tm_mon + 1; + d = t->tm_mday; + y = t->tm_year + 1900; +} + //////////////////////////////////////////////////////////////////////////////// ISO8601d ISO8601d::startOfDay () const { diff --git a/src/ISO8601.h b/src/ISO8601.h index 44373f220..ef55eafa5 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -46,6 +46,8 @@ public: operator time_t () const; bool parse (const std::string&, std::string::size_type&, const std::string& format = ""); + void toMDY (int&, int&, int&); + ISO8601d startOfDay () const; ISO8601d startOfWeek () const; ISO8601d startOfMonth () const;