commore
1.0.6-SNAPSHOT
|
#include <Time.h>
Public Member Functions | |
TimeDate (int year, int month, int day, int hour, int min, int second=0, int num_ms_or_um=0, bool is_millisecond=true) | |
TimeDate (const TimePeriod &period) | |
TimeDate (const tm &tm_struct, usecond_t microsecond=0) | |
TimeDate (const _FILETIME &time) | |
TimeDate (const time_t seconds) | |
TimeDate (const TimeDate &time_and_date) | |
TimeDate & | operator= (const TimeDate &time_and_date) |
TimeDate & | operator= (const tm &tm_struct) |
TimeDate & | operator= (const AString &text) |
operator tm () const | |
void | set_time_and_date (int year, int month, int day, int hour, int min, int second=0, int num_ms_or_um=0, bool is_millisecond=true) |
void | set_time_and_date (const tm &tm_struct, usecond_t microsecond=0) |
void | set_time_and_date (const time_t seconds) |
void | set_time_and_date (const TimePeriod &period) |
TimePeriod | get_time () const |
int | julian_day () const |
void | get_time_and_date (int &year, int &month, int &day, int &hour, int &min, int &second, int &num_ms_or_um, bool is_millisecond=true) const |
int | get_year () const |
int | get_month () const |
int | get_day () const |
int | get_hour () const |
int | get_minute () const |
int | get_second () const |
int | get_millisecond () const |
int | get_microsecond () const |
int | compare (const TimeDate &time) const |
AString | to_string (const AChar *format=0) const |
void | write (OBStream &stream) const |
long | read_xml (IBStream &i) |
long | write_xml (OBStream &o) const |
long | read (const CommBuffer &buf) |
long | write (CommBuffer &buf) const |
TimeDate | operator+ (const TimePeriod &period) const |
TimeDate | operator- (const TimePeriod &period) const |
TimeDate & | operator+= (const TimePeriod &period) |
TimeDate & | operator-= (const TimePeriod &period) |
TimeDate & | operator++ () |
TimeDate | operator++ (int) |
TimeDate & | operator-- () |
TimeDate | operator-- (int) |
TimePeriod | operator- (const TimeDate &time_and_date) const |
bool | operator== (const TimeDate &time_and_date) const |
bool | operator!= (const TimeDate &time_and_date) const |
bool | operator< (const TimeDate &time_and_date) const |
bool | operator<= (const TimeDate &time_and_date) const |
bool | operator> (const TimeDate &time_and_date) const |
bool | operator>= (const TimeDate &time_and_date) const |
Static Public Member Functions | |
static TimeDate | now () |
static TimeDate | epoch () |
Type time
commore::TimeDate::TimeDate | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
int | second = 0 , |
||
int | num_ms_or_um = 0 , |
||
bool | is_millisecond = true |
||
) |
year | |
month | (1 to 12) |
day | (1 to 31) |
hour | |
min | |
second | |
num_ms_or_um | number of miliseconds or microseconds |
is_millisecond | if true num_ms_or_um is a number of milliseconds |
commore::TimeDate::TimeDate | ( | const TimePeriod & | period | ) |
period | time since 01/01/1970 |
commore::TimeDate::TimeDate | ( | const time_t | seconds | ) |
seconds | time since 01/01/1970 |
int commore::TimeDate::compare | ( | const TimeDate & | time | ) | const |
|
static |
int commore::TimeDate::get_day | ( | ) | const |
int commore::TimeDate::get_hour | ( | ) | const |
int commore::TimeDate::get_microsecond | ( | ) | const |
int commore::TimeDate::get_millisecond | ( | ) | const |
int commore::TimeDate::get_minute | ( | ) | const |
int commore::TimeDate::get_month | ( | ) | const |
int commore::TimeDate::get_second | ( | ) | const |
TimePeriod commore::TimeDate::get_time | ( | ) | const |
void commore::TimeDate::get_time_and_date | ( | int & | year, |
int & | month, | ||
int & | day, | ||
int & | hour, | ||
int & | min, | ||
int & | second, | ||
int & | num_ms_or_um, | ||
bool | is_millisecond = true |
||
) | const |
Decompose time
int commore::TimeDate::get_year | ( | ) | const |
|
static |
|
inline |
operator on time
long commore::TimeDate::read | ( | const CommBuffer & | buf | ) |
Read time from text stream. Format: YYYY/MM/DD hh:mm:ss.qqq
long commore::TimeDate::read_xml | ( | IBStream & | i | ) |
Read time from text stream. Format: YYYY:MM:DDThh:mm:ss.qqq
void commore::TimeDate::set_time_and_date | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
int | second = 0 , |
||
int | num_ms_or_um = 0 , |
||
bool | is_millisecond = true |
||
) |
Assign time
AString commore::TimeDate::to_string | ( | const AChar * | format = 0 | ) | const |
void commore::TimeDate::write | ( | OBStream & | stream | ) | const |
Write time to text stream. Format: YYYY-MM-DD hh:mm:ss.qqq
long commore::TimeDate::write | ( | CommBuffer & | buf | ) | const |
Write time to text stream. Format: YYYY/MM/DD hh:mm:ss.qqq
long commore::TimeDate::write_xml | ( | OBStream & | o | ) | const |
Write time to text stream. Format: YYYY:MM:DDThh:mm:ss.qqq