tntdb
1.2
|
This class holds a time. More...
#include <time.h>
Public Member Functions | |
Time () | |
Initializes the Time-object with empty values. | |
Time (unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0) | |
Initializes the Time-object with the given values. | |
unsigned short | getHour () const |
Returns the hour-part of the Time. | |
unsigned short | getMinute () const |
Returns the minute-part of the Time. | |
unsigned short | getSecond () const |
Returns the second-part of the Time. | |
unsigned short | getMillis () const |
Returns the millisecond-part of the Time. | |
bool | isNull () const |
void | set (unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0) |
Sets the time. | |
std::string | getIso () const |
Returns the time in ISO-format (hh:mm:ss.hhh) | |
bool | operator== (const Time &dt) const |
bool | operator!= (const Time &dt) const |
bool | operator< (const Time &dt) const |
bool | operator> (const Time &dt) const |
bool | operator<= (const Time &dt) const |
bool | operator>= (const Time &dt) const |
Static Public Member Functions | |
static Time | localtime () |
static Time | gmtime () |
static Time | fromIso (const std::string &s) |
Interprets the passed string as a time-string in ISO-format (hh:mm:ss.hhh) and returns a Time-object. |
This class holds a time.
tntdb::Time::Time | ( | ) | [inline] |
Initializes the Time-object with empty values.
tntdb::Time::Time | ( | unsigned short | hour_, |
unsigned short | minute_, | ||
unsigned short | second_, | ||
unsigned short | millis_ = 0 |
||
) | [inline] |
Initializes the Time-object with the given values.
No range-checks are done.
static Time tntdb::Time::fromIso | ( | const std::string & | s | ) | [static] |
Interprets the passed string as a time-string in ISO-format (hh:mm:ss.hhh) and returns a Time-object.
When the string is not in ISO-format, a exception of type tntdb::TypeError is thrown.
unsigned short tntdb::Time::getHour | ( | ) | const [inline] |
Returns the hour-part of the Time.
std::string tntdb::Time::getIso | ( | ) | const |
Returns the time in ISO-format (hh:mm:ss.hhh)
unsigned short tntdb::Time::getMillis | ( | ) | const [inline] |
Returns the millisecond-part of the Time.
unsigned short tntdb::Time::getMinute | ( | ) | const [inline] |
Returns the minute-part of the Time.
unsigned short tntdb::Time::getSecond | ( | ) | const [inline] |
Returns the second-part of the Time.
void tntdb::Time::set | ( | unsigned short | hour_, |
unsigned short | minute_, | ||
unsigned short | second_, | ||
unsigned short | millis_ = 0 |
||
) | [inline] |
Sets the time.
No range-checks are done.