#include <Date.h>
Public Member Functions | |
| Date (time_t date_r=0) | |
| Date (const std::string &seconds_r) | |
| operator time_t () const | |
| Date & | operator+= (const time_t rhs) |
| Date & | operator-= (const time_t rhs) |
| Date & | operator *= (const time_t rhs) |
| Date & | operator/= (const time_t rhs) |
| Date & | operator++ () |
| Date & | operator-- () |
| Date | operator++ (int) |
| Date | operator-- (int) |
| std::string | form (const std::string &format) const |
| std::string | asString () const |
Static Public Member Functions | |
| static time_t | now () |
| static std::string | form (const std::string &format, time_t tval_r) |
| static time_t | fromSECONDS (const std::string &str_r) |
| static std::string | toSECONDS (time_t tval_r) |
Private Attributes | |
| time_t | _date |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const Date &obj) |
| Date::Date | ( | time_t | date_r = 0 |
) | [inline] |
Constructor
| Date::Date | ( | const std::string & | seconds_r | ) | [inline] |
| static time_t Date::now | ( | ) | [inline, static] |
Return the current time.
| static std::string Date::form | ( | const std::string & | format, | |
| time_t | tval_r | |||
| ) | [static] |
Return string representation of date according to format. See 'man strftime' (which is used internaly) for valid conversion specifiers in format.
Retruns an empty string on illegal format.
| static time_t Date::fromSECONDS | ( | const std::string & | str_r | ) | [static] |
Convert from string representation of calendar time in numeric form (like "1029255142").
| static std::string Date::toSECONDS | ( | time_t | tval_r | ) | [static] |
Convert to string representation of calendar time in numeric form (like "1029255142").
| Date::operator time_t | ( | ) | const [inline] |
Conversion to time_t
| Date& Date::operator+= | ( | const time_t | rhs | ) | [inline] |
| Date& Date::operator-= | ( | const time_t | rhs | ) | [inline] |
| Date& Date::operator *= | ( | const time_t | rhs | ) | [inline] |
| Date& Date::operator/= | ( | const time_t | rhs | ) | [inline] |
| Date& Date::operator++ | ( | ) | [inline] |
| Date& Date::operator-- | ( | ) | [inline] |
| Date Date::operator++ | ( | int | ) | [inline] |
| Date Date::operator-- | ( | int | ) | [inline] |
| std::string Date::form | ( | const std::string & | format | ) | const [inline] |
Member version of 'static form'.
| std::string Date::asString | ( | ) | const |
Default string representation of Date. The preferred date and time representation for the current locale.
| std::ostream& operator<< | ( | std::ostream & | str, | |
| const Date & | obj | |||
| ) | [friend] |
Write asString.
time_t Date::_date [private] |
Calendar time. The number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
1.5.3