libzypp
10.5.0
|
Store and operate on date (time_t). More...
#include <Date.h>
Public Types | |
enum | TimeBase { TB_LOCALTIME, TB_UTC } |
typedef time_t | ValueType |
Public Member Functions | |
Date () | |
Default ctor: 0. | |
Date (ValueType date_r) | |
Ctor taking time_t value. | |
Date (const std::string &seconds_r) | |
Ctor taking time_t value as string. | |
Date (const std::string &date_str, const std::string &format) | |
Ctor from a date_str (in localtime) formatted using format. | |
Date (const std::string &date_str, const std::string &format, TimeBase base_r) | |
operator ValueType () const | |
Conversion to time_t. | |
std::string | form (const std::string &format_r) const |
Return string representation according to format as localtime. | |
std::string | form (const std::string &format_r, TimeBase base_r) const |
std::string | asString () const |
Default string representation of Date. | |
std::string | asSeconds () const |
Convert to string representation of calendar time in numeric form (like "1029255142"). | |
Arithmetic operations. | |
| |
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) |
Static Public Member Functions | |
static Date | now () |
Return the current time. | |
Static Public Attributes | |
static const ValueType | second = 1 |
static const ValueType | minute = 60 |
static const ValueType | hour = 3600 |
static const ValueType | day = 86400 |
static const ValueType | month28 = 2419200 |
static const ValueType | month29 = 2505600 |
static const ValueType | month30 = 2592000 |
static const ValueType | month31 = 2678400 |
static const ValueType | month = month30 |
static const ValueType | year365 = 31536000 |
static const ValueType | year366 = 31622400 |
static const ValueType | year = year365 |
Private Attributes | |
ValueType | _date |
Calendar time. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const Date &obj) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const Date &obj) |
typedef time_t zypp::Date::ValueType |
enum zypp::Date::TimeBase |
zypp::Date::Date | ( | ValueType | date_r | ) | [inline] |
zypp::Date::Date | ( | const std::string & | seconds_r | ) |
zypp::Date::Date | ( | const std::string & | date_str, |
const std::string & | format | ||
) |
Ctor from a date_str (in localtime) formatted using format.
DateFormatException | in case date_str cannot be parsed according to format. |
zypp::Date::Date | ( | const std::string & | date_str, |
const std::string & | format, | ||
Date::TimeBase | base_r | ||
) |
static Date zypp::Date::now | ( | ) | [inline, static] |
zypp::Date::operator ValueType | ( | ) | const [inline] |
std::string zypp::Date::form | ( | const std::string & | format_r | ) | const [inline] |
std::string zypp::Date::form | ( | const std::string & | format_r, |
Date::TimeBase | base_r | ||
) | const |
std::string zypp::Date::asString | ( | ) | const [inline] |
std::string zypp::Date::asSeconds | ( | ) | const [inline] |
std::ostream& operator<< | ( | std::ostream & | str, |
const Date & | obj | ||
) | [friend] |
std::ostream & operator<< | ( | std::ostream & | str, |
const Date & | obj | ||
) | [related] |
const Date::ValueType zypp::Date::second = 1 [static] |
const Date::ValueType zypp::Date::minute = 60 [static] |
const Date::ValueType zypp::Date::hour = 3600 [static] |
const Date::ValueType zypp::Date::day = 86400 [static] |
const Date::ValueType zypp::Date::month28 = 2419200 [static] |
const Date::ValueType zypp::Date::month29 = 2505600 [static] |
const Date::ValueType zypp::Date::month30 = 2592000 [static] |
const Date::ValueType zypp::Date::month31 = 2678400 [static] |
const Date::ValueType zypp::Date::month = month30 [static] |
const Date::ValueType zypp::Date::year365 = 31536000 [static] |
const Date::ValueType zypp::Date::year366 = 31622400 [static] |
const Date::ValueType zypp::Date::year = year365 [static] |
ValueType zypp::Date::_date [private] |