rllib
1
|
#include <rltimeex.h>
Public Member Functions | |
rlTimeEx (int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0) | |
virtual | ~rlTimeEx () |
const char * | getTimeString () |
const char * | getIsoTimeString () |
const char * | toString (const char *format) |
void | getLocalTime () |
int | getFileModificationTime (const char *filename) |
void | setTimeFromString (const char *time_string) |
void | setTimeFromIsoString (const char *iso_time_string) |
void | setTimeFromSeconds (double seconds) |
void | setLocalTime () |
double | secondsSinceEpoche () const |
double | seconds () const |
rlTimeEx & | operator+= (rlTimeEx &time) |
rlTimeEx & | operator-= (rlTimeEx &time) |
rlTimeEx | operator+ (rlTimeEx &time) const |
rlTimeEx | operator- (rlTimeEx &time) const |
rlTimeEx & | operator+= (double seconds) |
rlTimeEx & | operator-= (double seconds) |
rlTimeEx | operator+ (double seconds) const |
rlTimeEx | operator- (double seconds) const |
int | operator== (rlTimeEx &time) const |
int | operator< (rlTimeEx &time) const |
int | operator<= (rlTimeEx &time) const |
int | operator> (rlTimeEx &time) const |
int | operator>= (rlTimeEx &time) const |
Public Attributes | |
int | year |
int | month |
int | day |
int | hour |
int | minute |
int | second |
int | millisecond |
Private Attributes | |
char | time_string [32 *2] |
char | iso_time_string [32] |
class for handling time.
Definition at line 24 of file rltimeex.h.
rlTimeEx::rlTimeEx | ( | int | Year = 0 , |
int | Month = 0 , |
||
int | Day = 0 , |
||
int | Hour = 0 , |
||
int | Minute = 0 , |
||
int | Second = 0 , |
||
int | Millisecond = 0 |
||
) |
Definition at line 64 of file rltimeex.cpp.
|
virtual |
Definition at line 75 of file rltimeex.cpp.
int rlTimeEx::getFileModificationTime | ( | const char * | filename | ) |
Definition at line 424 of file rltimeex.cpp.
const char * rlTimeEx::getIsoTimeString | ( | ) |
Definition at line 143 of file rltimeex.cpp.
void rlTimeEx::getLocalTime | ( | ) |
Definition at line 374 of file rltimeex.cpp.
const char * rlTimeEx::getTimeString | ( | ) |
Definition at line 137 of file rltimeex.cpp.
Definition at line 537 of file rltimeex.cpp.
rlTimeEx rlTimeEx::operator+ | ( | double | seconds | ) | const |
seconds := delta time milliseconds within the fraction calculating with 1 month <=> 30.5 days
Definition at line 743 of file rltimeex.cpp.
Definition at line 521 of file rltimeex.cpp.
rlTimeEx & rlTimeEx::operator+= | ( | double | seconds | ) |
seconds := delta time milliseconds within the fraction calculating with 1 month <=> 30.5 days
Definition at line 715 of file rltimeex.cpp.
Definition at line 615 of file rltimeex.cpp.
rlTimeEx rlTimeEx::operator- | ( | double | seconds | ) | const |
seconds := delta time milliseconds within the fraction calculating with 1 month <=> 30.5 days
Definition at line 756 of file rltimeex.cpp.
Definition at line 529 of file rltimeex.cpp.
rlTimeEx & rlTimeEx::operator-= | ( | double | seconds | ) |
seconds := delta time milliseconds within the fraction calculating with 1 month <=> 30.5 days
Definition at line 729 of file rltimeex.cpp.
int rlTimeEx::operator< | ( | rlTimeEx & | time | ) | const |
Definition at line 777 of file rltimeex.cpp.
int rlTimeEx::operator<= | ( | rlTimeEx & | time | ) | const |
Definition at line 802 of file rltimeex.cpp.
int rlTimeEx::operator== | ( | rlTimeEx & | time | ) | const |
Definition at line 764 of file rltimeex.cpp.
int rlTimeEx::operator> | ( | rlTimeEx & | time | ) | const |
Definition at line 809 of file rltimeex.cpp.
int rlTimeEx::operator>= | ( | rlTimeEx & | time | ) | const |
Definition at line 834 of file rltimeex.cpp.
double rlTimeEx::seconds | ( | ) | const |
seconds := delta time milliseconds within the fraction
Definition at line 873 of file rltimeex.cpp.
double rlTimeEx::secondsSinceEpoche | ( | ) | const |
Definition at line 841 of file rltimeex.cpp.
void rlTimeEx::setLocalTime | ( | ) |
Definition at line 451 of file rltimeex.cpp.
void rlTimeEx::setTimeFromIsoString | ( | const char * | iso_time_string | ) |
Definition at line 91 of file rltimeex.cpp.
void rlTimeEx::setTimeFromSeconds | ( | double | seconds | ) |
seconds := delta time milliseconds within the fraction calculating with 1 month <=> 30.5 days
Definition at line 108 of file rltimeex.cpp.
void rlTimeEx::setTimeFromString | ( | const char * | time_string | ) |
format: sscanf(time_string,"%d-%d-%d %d:%d:%d %d",&year,&month,&day, &hour,&minute,&second, &millisecond);
Definition at line 79 of file rltimeex.cpp.
const char * rlTimeEx::toString | ( | const char * | format | ) |
Returns the datetime as a string. The format parameter determines the format of the result string.
These expressions may be used for the date: Expression Output d the day as number without a leading zero (1 to 31) dd the day as number with a leading zero (01 to 31) M the month as number without a leading zero (1-12) MM the month as number with a leading zero (01-12) MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). yy the year as two digit number (00-99) yyyy the year as four digit number
These expressions may be used for the time: Expression Output h the hour without a leading zero (1 to 12 if AM/PM display) hh the hour with a leading zero (01 to 12 if AM/PM display) H the hour without a leading zero (0 to 23, even with AM/PM display) HH the hour with a leading zero (00 to 23, even with AM/PM display) m the minute without a leading zero (0 to 59) mm the minute with a leading zero (00 to 59) s the whole second without a leading zero (0 to 59) ss the whole second with a leading zero where applicable (00 to 59) z the fractional part of the second, to go after a decimal point, without trailing zeroes (0 to 999). zzz the fractional part of the second, to millisecond precision, including trailing zeroes where applicable (000 to 999). AP or A use AM/PM display. A/AP will be replaced by either "AM" or "PM". ap or a use am/pm display. a/ap will be replaced by either "am" or "pm".
All other input characters will be copyed
Example format strings (assumed that the rlTime is 21 May 2001 14:13:09.120): Format Result dd.MM.yyyy 21.05.2001 ddd MMMM d yy Tue May 21 01 hh:mm:ss.zzz 14:13:09.120 hh:mm:ss.z 14:13:09.12 h:m:s ap 2:13:9 pm
Definition at line 187 of file rltimeex.cpp.
int rlTimeEx::day |
Definition at line 60 of file rltimeex.h.
int rlTimeEx::hour |
Definition at line 61 of file rltimeex.h.
|
private |
Definition at line 67 of file rltimeex.h.
int rlTimeEx::millisecond |
Definition at line 64 of file rltimeex.h.
int rlTimeEx::minute |
Definition at line 62 of file rltimeex.h.
int rlTimeEx::month |
Definition at line 59 of file rltimeex.h.
int rlTimeEx::second |
Definition at line 63 of file rltimeex.h.
|
private |
Definition at line 66 of file rltimeex.h.
int rlTimeEx::year |
Definition at line 58 of file rltimeex.h.