diff --git a/date/date.h b/date/date.h index 157a6a9..e3cc2e2 100644 --- a/date/date.h +++ b/date/date.h @@ -85,6 +85,40 @@ public: Date & operator-=(time_t t); + /* + converts time_t in seconds (from unix epoch) to this object + */ + void FromTime(time_t t); + + + /* + converts tm structure to this object + */ + void FromTm(const tm & t); + + + /* + returns time_t (in seconds from unix epoch) + */ + time_t ToTime() const; + + + /* + return tm structure + only tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec fields are set + the rest is equal to zero + */ + tm ToTm() const; + + + /* + getting/setting the number of days from 0000:03:01 (year 0, month 3 - March, day 1) + (ToDays() and FromDays() can work even with a year less than 1970) + */ + long long ToDays() const; + void FromDays(long long g); + + /* returns a difference in second between two dates (always a value greater than zero) @@ -141,40 +175,6 @@ public: void AssertCorrectDate(); - /* - converts time_t in seconds (from unix epoch) to this object - */ - void FromTime(time_t t); - - - /* - converts tm structure to this object - */ - void FromTm(const tm & t); - - - /* - returns time_t (in seconds from unix epoch) - */ - time_t ToTime() const; - - - /* - return tm structure - only tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec fields are set - the rest is equal to zero - */ - tm ToTm() const; - - - /* - getting/setting the number of days from 0000:03:01 (year 0, month 3 - March, day 1) - (ToDays() and FromDays() can work even with a year less than 1970) - */ - long long ToDays() const; - void FromDays(long long g); - - /* returns how many days there is in a month y - year 1970 - ...