#include <date.h>
Public Member Functions | |
Date () | |
Initializes the Date-object with empty values. | |
Date (unsigned short year_, unsigned short month_, unsigned short day_) | |
Initializes the date-object with the given values. | |
unsigned short | getYear () const |
Returns the year-part of the Date. | |
unsigned short | getMonth () const |
Returns the month-part of the Date. | |
unsigned short | getDay () const |
Returns the day-part of the Date. | |
void | set (unsigned short year_, unsigned short month_, unsigned short day_) |
sets the date. | |
std::string | getIso () const |
returns the date in ISO-format (yyyy-mm-dd) | |
Static Public Member Functions | |
static Date | fromIso (const std::string &s) |
interprets the passed string as a date-string in ISO-format (yyyy-mm-dd) and returns a Date-object. |
tntdb::Date::Date | ( | ) | [inline] |
Initializes the Date-object with empty values.
tntdb::Date::Date | ( | unsigned short | year_, | |
unsigned short | month_, | |||
unsigned short | day_ | |||
) | [inline] |
Initializes the date-object with the given values.
No range-checks are done.
unsigned short tntdb::Date::getYear | ( | ) | const [inline] |
Returns the year-part of the Date.
unsigned short tntdb::Date::getMonth | ( | ) | const [inline] |
Returns the month-part of the Date.
unsigned short tntdb::Date::getDay | ( | ) | const [inline] |
Returns the day-part of the Date.
void tntdb::Date::set | ( | unsigned short | year_, | |
unsigned short | month_, | |||
unsigned short | day_ | |||
) | [inline] |
sets the date.
std::string tntdb::Date::getIso | ( | ) | const |
returns the date in ISO-format (yyyy-mm-dd)
static Date tntdb::Date::fromIso | ( | const std::string & | s | ) | [static] |
interprets the passed string as a date-string in ISO-format (yyyy-mm-dd) and returns a Date-object.
When the string is not in ISO-format, a exception of type tntdb::TypeError is thrown.