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.
|
| |
| void | set (BUInt year, BUInt month, BUInt day, BUInt hour=0, BUInt minute=0, BUInt second=0) |
| | Set the date and time.
|
| |
| void | setYearDay (BUInt year, BUInt yearDay, BUInt hour=0, BUInt minute=0, BUInt second=0) |
| | Set the date and time.
|
| |
| void | getDate (BUInt &year, BUInt &month, BUInt &day) const |
| | Retun the date information.
|
| |
| void | getTime (BUInt &hour, BUInt &minute, BUInt &second) const |
| | Return the time information.
|
| |
| BUInt32 | getSeconds () const |
| | Return the number of seconds.
|
| |
| int | isSet () const |
| | Check if set.
|
| |
| int | isLeapYear () |
| | Returns if a leap year.
|
| |
| void | addSeconds (int seconds) |
| | Add the given number of seconds.
|
| |
| BString | getString (BString format="iso") const |
| | Gets the date/time in string format.
|
| |
| BError | setString (const BString dateTime) |
| | Sets the date/time from string format.
|
| |
| BTime | utcToLocal () const |
| | Converts a UTC time to a local time.
|
| |
| BTime | localToUtc () const |
| | Converts a local time to UTC time.
|
| |
| BString | getStringLocal (BString format="iso") const |
| | Gets the date/time in string format.
|
| |
| BError | setStringLocal (const BString dateTime) |
| | Sets the date/time from string format.
|
| |
| 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.