X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0824e369691b4a23a484e1d258b6e4ea021b022a..1b7751aaa9a86d76a850b9267bc0c201e3cea30f:/interface/wx/datetime.h diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index 46106b11bf..f49315e693 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -482,7 +482,7 @@ public: /** Constructs the object from @a timet value holding the number of seconds - since Jan 1, 1970. + since Jan 1, 1970 UTC. If @a timet is invalid, i.e. @code (time_t)-1 @endcode, wxDateTime becomes invalid too, i.e. its IsValid() will return @false. @@ -668,8 +668,10 @@ public: unsigned short GetSecond(const TimeZone& tz = Local) const; /** - Returns the number of seconds since Jan 1, 1970. An assert failure will - occur if the date is not in the range covered by @c time_t type. + Returns the number of seconds since Jan 1, 1970 UTC. + + An assert failure will occur if the date is not in the range covered by + @c time_t type, use GetValue() if you work with dates outside of it. */ time_t GetTicks() const; @@ -818,7 +820,7 @@ public: /** Adds the given date span to this object. */ - wxDateTime Add(const wxDateSpan& diff); + wxDateTime& Add(const wxDateSpan& diff); /** Adds the given time span to this object. */ @@ -863,18 +865,39 @@ public: Adds the given date span to this object. */ wxDateTime& operator+=(const wxDateSpan& diff); + /** + Adds the given date span to this object. + */ + wxDateTime operator+(const wxDateSpan& ds) const; /** Subtracts the given date span from this object. */ wxDateTime& operator-=(const wxDateSpan& diff); + /** + Subtracts the given date span from this object. + */ + wxDateTime operator-(const wxDateSpan& ds) const; /** Adds the given time span to this object. */ wxDateTime& operator+=(const wxTimeSpan& diff); + /** + Adds the given time span to this object. + */ + wxDateTime operator+(const wxTimeSpan& ts) const; /** Subtracts the given time span from this object. */ wxDateTime& operator-=(const wxTimeSpan& diff); + /** + Subtracts the given time span from this object. + */ + wxDateTime operator-(const wxTimeSpan& ts) const; + /** + Subtracts another date from this one and returns the difference between + them as a wxTimeSpan. + */ + wxTimeSpan operator-(const wxDateTime& dt2) const; //@}