|
Constructors. |
Attach to various system date/time types.
|
|
| datetime_t () |
| | Constructor.
|
|
| datetime_t (DATE date) |
| | Constructor from raw DATE type.
|
| | datetime_t (int year, int month, int day, int hours=-1, int minutes=0, int seconds=0, int milliseconds=0) |
| | Construct from date/time components.
|
|
| datetime_t (dt_invalid_t) |
| | Initialise as invalid.
|
|
| datetime_t (dt_null_t) |
| | Initialise as null.
|
|
| datetime_t (dt_zero_t) |
| | Initialise as zero.
|
| | datetime_t (const SYSTEMTIME &systimeSrc) |
| | Construct from a SYSTEMTIME.
|
| | datetime_t (const SYSTEMTIME &systimeSrc, utc_convert_mode utcMode, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| | Construct from a SYSTEMTIME.
|
| | datetime_t (const FILETIME &filetimeSrc, utc_convert_mode utcMode=ucm_none, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| | Construct from a FILETIME.
|
| | datetime_t (time_t timeSrc, utc_convert_mode utcMode=ucm_utc_to_local, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| | Construct from time_t.
|
|
| datetime_t (const datetime_t &date) |
| | Copy constructor.
|
|
datetime_t | get_null () |
| | Get a 'NULL' datetime.
|
|
datetime_t | get_zero () |
| | Get a 'zero' datetime.
|
Public Types |
| enum | utc_convert_mode { ucm_none,
ucm_local_to_utc,
ucm_utc_to_local
} |
| enum | tz_bias_mode { tbm_use_local_date,
tbm_use_utc_date,
tbm_force_standard,
tbm_force_summer
} |
| | Describe how to get the timezone bias. More...
|
| enum | day_of_week {
dow_sun = 0,
dow_mon,
dow_tue,
dow_wed,
dow_thu,
dow_fri,
dow_sat
} |
| | Day-of-week enumeration.
|
| enum | format_flags {
ff_default = 0,
ff_system_locale = LOCALE_NOUSEROVERRIDE,
ff_hijri = VAR_CALENDAR_HIJRI,
ff_thai = 0x10,
ff_gregorian = 0x20,
ff_four_digits = VAR_FOURDIGITYEARS,
ff_time_only = VAR_TIMEVALUEONLY,
ff_date_only = VAR_DATEVALUEONLY
} |
| | Flags for formatting. More...
|
Public Member Functions |
| datetime_t & | add_months (int inc_months) |
|
datetime_t & | add_years (int inc_years) |
| | Add specified number of years.
|
|
void | split_date (int *year, int *month, int *day) const |
| | Return year/month/day values.
|
|
void | split_time (int *hours, int *minutes, int *seconds, int *milliseconds=NULL) const |
| | Return hours/minutes/second values.
|
|
void | split (int *year, int *month, int *day, int *hours, int *minutes, int *seconds, int *milliseconds=NULL) |
| | Return date/time split up.
|
|
bool | invalid () const |
| | return true if the date is marked 'invalid'.
|
|
bool | null () const |
| | return true if the date is marked 'null'
|
|
bool | zero () const |
| | return true if date is zero
|
| bool | valid () const |
|
bool | good () const |
| | Return true if the date is usable.
|
| bool | set_date (int year, int month, int day) |
| bool | set_time (int hours, int minutes, int seconds, int milliseconds=0) |
| bool | set_date_time (int year, int month, int day, int hours, int minutes, int seconds, int milliseconds=0) |
| datetime_t & | parse (const bstr_t &val, format_flags flags=ff_default, LCID locale=LOCALE_USER_DEFAULT) |
| double | as_sortable_double () const |
| datetime_t | local_to_utc (tz_bias_mode biasMode=tbm_use_local_date, datetime_t asOfDate=datetime_t()) |
| datetime_t | utc_to_local (tz_bias_mode biasMode=tbm_use_local_date, datetime_t asOfDate=datetime_t()) |
| bool | to_systemtime (SYSTEMTIME *sysTime) |
| bool | from_systemtime (const SYSTEMTIME &src) |
| bool | from_systemtime (const SYSTEMTIME &src, utc_convert_mode utcMode, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| bool | from_filetime (const FILETIME &src) |
| bool | from_filetime (const FILETIME &src, utc_convert_mode utcMode, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| bool | to_filetime (FILETIME *filetime) |
| bool | from_tm (const struct tm &tm_time) |
| bool | from_tm (const struct tm &tm_time, utc_convert_mode utcMode, tz_bias_mode biasMode=tbm_use_local_date, datetime_t conversionTime=datetime_t()) |
| bool | from_unixtime (time_t val) |
| bool | from_unixtime (time_t val, utc_convert_mode utcMode=ucm_utc_to_local, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| bool | to_unixtime (time_t *val, utc_convert_mode utcMode=ucm_local_to_utc, tz_bias_mode biasMode=tbm_use_local_date, const datetime_t &conversionTime=datetime_t()) |
| bstr_t | format (format_flags flags=ff_default, LCID locale=LOCALE_USER_DEFAULT) const |
| template<typename CHAR> std::basic_string< CHAR > | format (const std::basic_string< CHAR > &fmt) const |
| template<typename CHAR> std::basic_string< CHAR > | format (const CHAR *fmt) const |
|
DATE | detach () |
| | Detach the raw date from the class.
|
|
|
int | year () const |
| | Year.
|
|
int | month () const |
| | Month of year (1-based).
|
|
int | day () const |
| | Day of month (1-based).
|
|
int | hour () const |
| | Hour part of time (0-based) ???
|
|
int | minute () const |
| | Minute part of time (0-based).
|
|
int | second () const |
| | Second.
|
|
int | millisecond () const |
| | Milliseconds.
|
|
day_of_week | dow () const |
| | The day of week.
|
|
int | year_day () const |
| | Day of the year (0 -based).
|
|
int | days_in_month () |
| | Days in the month;.
|
|
|
datetime_t & | operator= (const datetime_t &date) |
|
datetime_t & | operator= (DATE date) |
|
|
bool | operator== (const datetime_t &date) const |
|
bool | operator!= (const datetime_t &date) const |
|
bool | operator< (const datetime_t &date) const |
|
bool | operator> (const datetime_t &date) const |
|
bool | operator<= (const datetime_t &date) const |
|
bool | operator>= (const datetime_t &date) const |
|
bool | operator== (dt_invalid_t) const |
|
bool | operator!= (dt_invalid_t) const |
|
bool | operator== (dt_zero_t) const |
|
bool | operator!= (dt_zero_t) const |
|
bool | operator== (dt_null_t) const |
|
bool | operator!= (dt_null_t) const |
|
|
datetime_t | operator+ (const timeperiod_t &dateSpan) const |
|
datetime_t | operator- (const timeperiod_t &dateSpan) const |
|
datetime_t & | operator+= (const timeperiod_t &dateSpan) |
|
datetime_t & | operator-= (const timeperiod_t &dateSpan) |
|
timeperiod_t | operator- (const datetime_t &date) const |
|
datetime_t & | operator++ () |
|
datetime_t | operator++ (int) |
|
datetime_t & | operator-- () |
|
datetime_t | operator-- (int) |
|
|
DATE | get () const |
|
DATE | in () const |
|
DATE * | in_ptr () const |
|
DATE * | out () |
|
DATE * | inout () |
Static Public Member Functions |
|
const datetime_t & | create_const_reference (const DATE &s) throw () |
| | Create a const reference.
|
|
datetime_t & | create_reference (DATE &s) throw () |
| | Create a non-const reference.
|
|
datetime_t | now () |
| | Return the current time.
|
|
datetime_t | now_utc () |
| | Return the current utc time.
|
|
int | days_in_month (int year, int month) |
| long | local_timezone_bias (datetime_t dt, tz_bias_mode biasMode) |
|
DATE | detach (datetime_t &dt) |
| | Detach the raw date from the class.
|
Static Protected Member Functions |
| bool | tz_on_or_after_in_year (SYSTEMTIME testST, SYSTEMTIME tziST) |
|
void | tz_convert_relative_dow_to_absolute (const SYSTEMTIME &testST, const SYSTEMTIME &tziST, SYSTEMTIME *absST) |
Friends |
|
std::basic_ostream< char > & | operator<< (std::basic_ostream< char > &os, const datetime_t &val) |
| | Stream operator.
|
|
std::basic_ostream< wchar_t > & | operator<< (std::basic_ostream< wchar_t > &os, const datetime_t &val) |
| | Stream operator.
|
Wrapper for DATE. DATE/TIME Represented as days + fraction of days.