tntdb 1.4
|
This class holds a time. More...
#include <time.h>
Public Member Functions | |
Time () | |
Create a Time object with empty values. | |
Time (unsigned short hour, unsigned short minute, unsigned short second, unsigned short millis=0) | |
Create a Time object with the given values. | |
unsigned short | getHour () const |
Get the hour part of the Time. | |
unsigned short | getMinute () const |
Get the minute part of the Time. | |
unsigned short | getSecond () const |
Get the second part of the Time. | |
unsigned short | getMillis () const |
Get 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 |
Get 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) |
Construct a Time object from the given ISO date string. | |
This class holds a time.
|
inline |
Create a Time object with empty values.
|
inline |
Create a Time object with the given values.
No range checks are done.
Construct a Time object from the given ISO date string.
If the string is not in ISO format, an exception of type tntdb::TypeError is thrown.
std::string tntdb::Time::getIso | ( | ) | const |
Get the time in ISO format (hh:mm:ss.hhh)
|
inline |
Sets the time.
No range checks are done