This class holds a date and a time.
More...
#include <datetime.h>
|
| Datetime () |
| Initializes the Datetime-object with empty values. More...
|
|
| Datetime (const Date &date, const Time &time) |
|
| Datetime (unsigned short year_, unsigned short month_, unsigned short day_, unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0) |
| Initializes the Datetime-object with the given values. More...
|
|
unsigned short | getYear () const |
| Returns the year-part of the Datetime. More...
|
|
unsigned short | getMonth () const |
| Returns the month-part of the Datetime. More...
|
|
unsigned short | getDay () const |
| Returns the day-part of the Datetime. More...
|
|
unsigned short | getHour () const |
| Returns the hour-part of the Datetime. More...
|
|
unsigned short | getMinute () const |
| Returns the minute-part of the Datetime. More...
|
|
unsigned short | getSecond () const |
| Returns the second-part of the Datetime. More...
|
|
unsigned short | getMillis () const |
| Returns the millisecond-part of the Datetime. More...
|
|
Date | getDate () const |
|
Time | getTime () const |
|
bool | isNull () const |
|
std::string | getIso () const |
| Returns the date in ISO-format (yyyy-mm-dd hh:mm:ss.hhh) More...
|
|
void | set (unsigned short year_, unsigned short month_, unsigned short day_, unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0) |
| Sets the date and the time. More...
|
|
bool | operator== (const Datetime &dt) const |
|
bool | operator!= (const Datetime &dt) const |
|
bool | operator< (const Datetime &dt) const |
|
bool | operator> (const Datetime &dt) const |
|
bool | operator<= (const Datetime &dt) const |
|
bool | operator>= (const Datetime &dt) const |
|
|
static Datetime | localtime () |
|
static Datetime | gmtime () |
|
static Datetime | fromIso (const std::string &s) |
| Interprets the passed string as a datetime-string in ISO-format (yyyy-mm-dd hh:mm:ss.hhh) and returns a Datetime-object. More...
|
|
This class holds a date and a time.
◆ Datetime() [1/2]
tntdb::Datetime::Datetime |
( |
| ) |
|
|
inline |
Initializes the Datetime-object with empty values.
◆ Datetime() [2/2]
tntdb::Datetime::Datetime |
( |
unsigned short |
year_, |
|
|
unsigned short |
month_, |
|
|
unsigned short |
day_, |
|
|
unsigned short |
hour_, |
|
|
unsigned short |
minute_, |
|
|
unsigned short |
second_, |
|
|
unsigned short |
millis_ = 0 |
|
) |
| |
|
inline |
Initializes the Datetime-object with the given values.
No range-checks are done.
◆ fromIso()
static Datetime tntdb::Datetime::fromIso |
( |
const std::string & |
s | ) |
|
|
static |
Interprets the passed string as a datetime-string in ISO-format (yyyy-mm-dd hh:mm:ss.hhh) and returns a Datetime-object.
When the string is not in ISO-format, a exception of type tntdb::TypeError is thrown.
◆ getDay()
unsigned short tntdb::Datetime::getDay |
( |
| ) |
const |
|
inline |
◆ getHour()
unsigned short tntdb::Datetime::getHour |
( |
| ) |
const |
|
inline |
◆ getIso()
std::string tntdb::Datetime::getIso |
( |
| ) |
const |
Returns the date in ISO-format (yyyy-mm-dd hh:mm:ss.hhh)
◆ getMillis()
unsigned short tntdb::Datetime::getMillis |
( |
| ) |
const |
|
inline |
Returns the millisecond-part of the Datetime.
◆ getMinute()
unsigned short tntdb::Datetime::getMinute |
( |
| ) |
const |
|
inline |
Returns the minute-part of the Datetime.
◆ getMonth()
unsigned short tntdb::Datetime::getMonth |
( |
| ) |
const |
|
inline |
◆ getSecond()
unsigned short tntdb::Datetime::getSecond |
( |
| ) |
const |
|
inline |
Returns the second-part of the Datetime.
◆ getYear()
unsigned short tntdb::Datetime::getYear |
( |
| ) |
const |
|
inline |
◆ set()
void tntdb::Datetime::set |
( |
unsigned short |
year_, |
|
|
unsigned short |
month_, |
|
|
unsigned short |
day_, |
|
|
unsigned short |
hour_, |
|
|
unsigned short |
minute_, |
|
|
unsigned short |
second_, |
|
|
unsigned short |
millis_ = 0 |
|
) |
| |
|
inline |
Sets the date and the time.
No range-checks are done.
The documentation for this class was generated from the following file: