rllib
1
|
#include <rltime.h>
Public Member Functions | |
rlTime (int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0) | |
virtual | ~rlTime () |
const char * | version () |
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 | setLocalTime () |
double | secondsSinceEpoche () |
rlTime & | operator+= (rlTime &time) |
rlTime & | operator-= (rlTime &time) |
rlTime | operator+ (rlTime &time) |
rlTime | operator- (rlTime &time) |
int | operator== (rlTime &time) |
int | operator< (rlTime &time) |
int | operator<= (rlTime &time) |
int | operator> (rlTime &time) |
int | operator>= (rlTime &time) |
Public Attributes | |
int | year |
int | month |
int | day |
int | hour |
int | minute |
int | second |
int | millisecond |
Private Attributes | |
char | time_string [32] |
char | iso_time_string [32] |
rlTime::rlTime | ( | int | Year = 0 , |
int | Month = 0 , |
||
int | Day = 0 , |
||
int | Hour = 0 , |
||
int | Minute = 0 , |
||
int | Second = 0 , |
||
int | Millisecond = 0 |
||
) |
Definition at line 62 of file rltime.cpp.
|
virtual |
Definition at line 73 of file rltime.cpp.
int rlTime::getFileModificationTime | ( | const char * | filename | ) |
Definition at line 392 of file rltime.cpp.
const char * rlTime::getIsoTimeString | ( | ) |
Definition at line 112 of file rltime.cpp.
void rlTime::getLocalTime | ( | ) |
Definition at line 342 of file rltime.cpp.
const char * rlTime::getTimeString | ( | ) |
Definition at line 106 of file rltime.cpp.
Definition at line 505 of file rltime.cpp.
Definition at line 489 of file rltime.cpp.
Definition at line 583 of file rltime.cpp.
Definition at line 497 of file rltime.cpp.
int rlTime::operator< | ( | rlTime & | time | ) |
Definition at line 693 of file rltime.cpp.
int rlTime::operator<= | ( | rlTime & | time | ) |
Definition at line 718 of file rltime.cpp.
int rlTime::operator== | ( | rlTime & | time | ) |
Definition at line 680 of file rltime.cpp.
int rlTime::operator> | ( | rlTime & | time | ) |
Definition at line 725 of file rltime.cpp.
int rlTime::operator>= | ( | rlTime & | time | ) |
Definition at line 750 of file rltime.cpp.
double rlTime::secondsSinceEpoche | ( | ) |
Definition at line 757 of file rltime.cpp.
void rlTime::setLocalTime | ( | ) |
Definition at line 419 of file rltime.cpp.
void rlTime::setTimeFromIsoString | ( | const char * | iso_time_string | ) |
Definition at line 94 of file rltime.cpp.
void rlTime::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 82 of file rltime.cpp.
const char * rlTime::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 156 of file rltime.cpp.
const char * rlTime::version | ( | ) |
Definition at line 77 of file rltime.cpp.