This class holds a time.
More...
#include <time.h>
|
| Time () |
| Initializes the Time-object with empty values. More...
|
|
| Time (unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0) |
| Initializes the Time-object with the given values. More...
|
|
unsigned short | getHour () const |
| Returns the hour-part of the Time. More...
|
|
unsigned short | getMinute () const |
| Returns the minute-part of the Time. More...
|
|
unsigned short | getSecond () const |
| Returns the second-part of the Time. More...
|
|
unsigned short | getMillis () const |
| Returns the millisecond-part of the Time. More...
|
|
bool | isNull () const |
|
void | set (unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0) |
| Sets the time. More...
|
|
std::string | getIso () const |
| Returns the time in ISO-format (hh:mm:ss.hhh) More...
|
|
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 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. More...
|
|
◆ Time() [1/2]
Initializes the Time-object with empty values.
◆ Time() [2/2]
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.
◆ fromIso()
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.
◆ getHour()
unsigned short tntdb::Time::getHour |
( |
| ) |
const |
|
inline |
Returns the hour-part of the Time.
◆ getIso()
std::string tntdb::Time::getIso |
( |
| ) |
const |
Returns the time in ISO-format (hh:mm:ss.hhh)
◆ getMillis()
unsigned short tntdb::Time::getMillis |
( |
| ) |
const |
|
inline |
Returns the millisecond-part of the Time.
◆ getMinute()
unsigned short tntdb::Time::getMinute |
( |
| ) |
const |
|
inline |
Returns the minute-part of the Time.
◆ getSecond()
unsigned short tntdb::Time::getSecond |
( |
| ) |
const |
|
inline |
Returns the second-part of the Time.
◆ set()
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.
The documentation for this class was generated from the following file: