libzypp
13.10.6
|
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. More... | |
Date (ValueType date_r) | |
Ctor taking time_t value. More... | |
Date (const std::string &seconds_r) | |
Ctor taking time_t value as string. More... | |
Date (const std::string &date_str, const std::string &format) | |
Ctor from a date_str (in localtime) formatted using format. More... | |
Date (const std::string &date_str, const std::string &format, TimeBase base_r) | |
operator ValueType () const | |
Conversion to time_t. More... | |
std::string | form (const std::string &format_r) const |
Return string representation according to format as localtime. More... | |
std::string | form (const std::string &format_r, TimeBase base_r) const |
std::string | asString () const |
Default string representation of Date. More... | |
std::string | asSeconds () const |
Convert to string representation of calendar time in numeric form (like "1029255142"). More... | |
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. More... | |
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. More... | |
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 |
|
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 | ||
) |
|
inlinestatic |
|
inline |
|
inline |
std::string zypp::Date::form | ( | const std::string & | format_r, |
Date::TimeBase | base_r | ||
) | const |
|
inline |
|
inline |
|
friend |
|
related |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |