diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index d6c0e73e7..6fa9df6c1 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -840,6 +840,12 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start) return false; } +//////////////////////////////////////////////////////////////////////////////// +ISO8601d ISO8601d::startOfDay () const +{ + return ISO8601d (month (), day (), year ()); +} + //////////////////////////////////////////////////////////////////////////////// // Static bool ISO8601d::leapYear (int year) diff --git a/src/ISO8601.h b/src/ISO8601.h index 559794f4e..d4cd49768 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -43,10 +43,11 @@ public: ISO8601d (const int, const int, const int, const int, const int, const int); ~ISO8601d (); ISO8601d (const ISO8601d&); // Unimplemented - ISO8601d& operator= (const ISO8601d&); // Unimplemented operator time_t () const; bool parse (const std::string&, std::string::size_type&, const std::string& format = ""); + ISO8601d startOfDay () const; + static bool leapYear (int); static int daysInMonth (int, int); static int daysInYear (int);