X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c21e80bb05128b6b3b886ae5163d52da4bff2a9..fdc62f44622dfcfea2f43910478fe5bb8ac0e938:/include/wx/datetime.h diff --git a/include/wx/datetime.h b/include/wx/datetime.h index b0edbf9efe..15f344cbf8 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -503,7 +503,7 @@ public: static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian); // get the century (19 for 1999, 20 for 2000 and -5 for 492 BC) - static int GetCentury(int year = Inv_Year); + static int GetCentury(int year); // returns the number of days in this year (356 or 355 for Gregorian // calendar usually :-) @@ -838,6 +838,9 @@ public: // if the value is out of range inline time_t GetTicks() const; + // get the century, same as GetCentury(GetYear()) + int GetCentury(const TimeZone& tz = Local) const + { return GetCentury(GetYear(tz)); } // get the year (returns Inv_Year if date is invalid) int GetYear(const TimeZone& tz = Local) const { return GetTm(tz).year; } @@ -1114,6 +1117,10 @@ public: // constructors // ------------------------------------------------------------------------ + // return the timespan for the given number of milliseconds + static wxTimeSpan Milliseconds(wxLongLong ms) { return wxTimeSpan(0, 0, 0, ms); } + static wxTimeSpan Millisecond() { return Milliseconds(1); } + // return the timespan for the given number of seconds static wxTimeSpan Seconds(wxLongLong sec) { return wxTimeSpan(0, 0, sec); } static wxTimeSpan Second() { return Seconds(1); }