Implements a simple date/time class. Stores the date/time as a number of seconds since Unix epoch 1970-01-02T00:00:00.
More...
|
| BTime (BUInt32 t=0) |
|
void | set (BUInt32 seconds) |
| Set the date and time. More...
|
|
void | set (BUInt year, BUInt month, BUInt day, BUInt hour=0, BUInt minute=0, BUInt second=0) |
| Set the date and time. More...
|
|
void | setYearDay (BUInt year, BUInt yearDay, BUInt hour=0, BUInt minute=0, BUInt second=0) |
| Set the date and time. More...
|
|
void | getDate (BUInt &year, BUInt &month, BUInt &day) const |
| Retun the date information. More...
|
|
void | getTime (BUInt &hour, BUInt &minute, BUInt &second) const |
| Return the time information. More...
|
|
BUInt32 | getSeconds () const |
| Return the number of seconds. More...
|
|
int | isSet () const |
| Check if set. More...
|
|
int | isLeapYear () |
| Returns if a leap year. More...
|
|
void | addSeconds (int seconds) |
| Add the given number of seconds. More...
|
|
BString | getString (BString format="iso") const |
| Gets the date/time in string format. More...
|
|
BError | setString (const BString dateTime) |
| Sets the date/time from string format. More...
|
|
BTime | utcToLocal () const |
| Converts a UTC time to a local time. More...
|
|
BTime | localToUtc () const |
| Converts a local time to UTC time. More...
|
|
BString | getStringLocal (BString format="iso") const |
| Gets the date/time in string format. More...
|
|
BError | setStringLocal (const BString dateTime) |
| Sets the date/time from string format. More...
|
|
int | operator== (const BTime &time) const |
|
int | operator!= (const BTime &time) const |
|
int | operator> (const BTime &time) const |
|
int | operator>= (const BTime &time) const |
|
int | operator< (const BTime &time) const |
|
int | operator<= (const BTime &time) const |
|
BTime | operator+ (int seconds) const |
|
BTime & | operator+= (int seconds) |
|
Implements a simple date/time class. Stores the date/time as a number of seconds since Unix epoch 1970-01-02T00:00:00.
BTime has a range until 2106-02-07. This sets and returns datetime strings in UTC time by default. There are also *Local() functions to return and set using local time strings.
Uses some sepcial values. 0 - DateTime not set.