diff options
Diffstat (limited to 'include/datetime/date-time.h')
-rw-r--r-- | include/datetime/date-time.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/datetime/date-time.h b/include/datetime/date-time.h index 7dfc207..ea9ea36 100644 --- a/include/datetime/date-time.h +++ b/include/datetime/date-time.h @@ -22,6 +22,7 @@ #include <glib.h> // GDateTime +#include <chrono> #include <ctime> // time_t #include <memory> // std::shared_ptr @@ -36,13 +37,16 @@ class DateTime { public: static DateTime NowLocal(); + static DateTime Local(time_t); static DateTime Local(int year, int month, int day, int hour, int minute, double seconds); DateTime(); - explicit DateTime(time_t t); + DateTime(GTimeZone* tz, time_t t); DateTime(GTimeZone* tz, GDateTime* dt); DateTime(GTimeZone* tz, int year, int month, int day, int hour, int minute, double seconds); DateTime& operator=(const DateTime& in); + DateTime& operator+=(const std::chrono::minutes&); + DateTime& operator+=(const std::chrono::seconds&); DateTime to_timezone(const std::string& zone) const; DateTime start_of_month() const; DateTime start_of_day() const; |