35 #include "../System/cl_platform.h" 56 DateTime(
int year,
int month,
int day,
int hour = 0,
int minute = 0,
int seconds = 0,
int nanoseconds = 0,
TimeZone timezone=
utc_timezone);
117 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);
171 void throw_if_invalid_date(
int year,
int month,
int day,
int hour,
int minute,
int seconds,
int nanoseconds)
const;
172 void throw_if_null()
const;
174 int get_day_number()
const;
175 void set_date_from_daynumber(
int g);
181 unsigned char minute;
182 unsigned char seconds;
183 unsigned int nanoseconds;
186 static const int64_t ticks_from_1601_to_1900;
unsigned char get_seconds() const
void set_seconds(int seconds)
std::string to_short_date_string() const
yyyy-mm-dd
DateTime & add_months(int months)
unsigned char get_week() const
Returns the ISO 8601 week number of the date.
unsigned int get_day_of_week() const
Get the day of the week.
bool operator>(const DateTime &other) const
unsigned char get_month() const
Returns the month number in range 1-12.
unsigned char get_day() const
Date/Time class.
Definition: datetime.h:43
TimeZone
Definition: datetime.h:48
unsigned char get_minutes() const
void set_timezone(TimeZone timezone)
bool operator==(const DateTime &other) const
static DateTime get_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...
bool operator<(const DateTime &other) const
unsigned short get_year() const
bool operator<=(const DateTime &other) const
Definition: datetime.h:51
DateTime to_local() const
void set_nanoseconds(int nanoseconds)
static DateTime get_current_local_time()
Get current system time in local time zone.
DateTime & add_years(int years)
DateTime()
Constructs a date/time object.
static DateTime from_short_date_string(const std::string &value)
std::string to_long_date_string() const
Mon Mar 3 2007.
DateTime & add_days(int days)
std::string to_short_datetime_string() const
yyyy-mm-dd hh:mm:ss
std::string to_string() const
Mon Feb 3 12:32:54 2008.
bool operator!=(const DateTime &other) const
Definition: datetime.h:50
bool operator>=(const DateTime &other) const
int64_t to_ticks() const
Converts the date to the number of 100-nanosecond intervals since January 1, 1601 UTC...
static int get_days_in_month(int month, int year)
Returns the number of days in the given month.
static DateTime get_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 int get_nanoseconds() const
std::string to_long_time_string() const
hh:mm:ss
int get_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_time_string() const
hh:mm
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)
void set_minutes(int minutes)
TimeZone get_timezone() const
void set_month(int month)
unsigned char get_hour() const
static DateTime get_current_utc_time()
Get current system time in UTC.