67 unsigned short year()
const;
72 unsigned char month()
const;
73 unsigned char day()
const;
74 unsigned char hour()
const;
83 unsigned char week()
const;
153 void throw_if_null()
const;
155 int day_number()
const;
156 void set_date_from_daynumber(
int g);
158 unsigned short _year;
159 unsigned char _month;
162 unsigned char _minute;
163 unsigned char _seconds;
164 unsigned int _nanoseconds;
167 static const int64_t ticks_from_1601_to_1900;
static DateTime current_utc_time()
Get current system time in UTC.
static DateTime utc_time_from_ticks(int64_t ticks)
Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date t...
void set_month(int month)
TimeZone timezone() const
std::string to_long_time_string() const
hh:mm:ss
DateTime & add_days(int days)
int difference_in_days(const DateTime &other) const
Returns the difference in days between two dates. This function is only accurate for the next few mil...
std::string to_short_date_string() const
yyyy-mm-dd
void set_nanoseconds(int nanoseconds)
Definition: datetime.h:43
std::string to_short_time_string() const
hh:mm
static DateTime current_local_time()
Get current system time in local time zone.
void set_timezone(TimeZone timezone)
unsigned char seconds() const
TimeZone
Definition: datetime.h:41
unsigned char minutes() const
unsigned int nanoseconds() const
DateTime & add_months(int months)
unsigned int day_of_week() const
Get the day of the week.
static int days_in_month(int month, int year)
Returns the number of days in the given month.
bool operator!=(const DateTime &other) const
std::string to_string() const
Mon Feb 3 12:32:54 2008.
DateTime & add_years(int years)
unsigned short year() const
static DateTime from_short_date_string(const std::string &value)
bool operator==(const DateTime &other) const
DateTime to_local() const
void set_minutes(int minutes)
static DateTime local_time_from_ticks(int64_t ticks)
Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date t...
unsigned char day() const
std::string to_short_datetime_string() const
yyyy-mm-dd hh:mm:ss
bool operator>(const DateTime &other) const
unsigned char month() const
Returns the month number in range 1-12.
bool operator<=(const DateTime &other) const
std::string to_long_date_string() const
Mon Mar 3 2007.
Definition: datetime.h:44
void set_seconds(int seconds)
DateTime()
Constructs a date/time object.
int64_t to_ticks() const
Converts the date to the number of 100-nanosecond intervals since January 1, 1601 UTC...
unsigned char hour() const
Definition: Application/application.h:35
bool operator<(const DateTime &other) const
bool operator>=(const DateTime &other) const
Date/Time class.
Definition: datetime.h:38
void set_date(int year, int month, int day, int hour=0, int minute=0, int seconds=0, int nanoseconds=0, TimeZone timezone=utc_timezone)
unsigned char week() const
Returns the ISO 8601 week number of the date.