35 #include "../api_core.h"
36 #include "../System/cl_platform.h"
57 DateTime(
int year,
int month,
int day,
int hour = 0,
int minute = 0,
int seconds = 0,
int nanoseconds = 0, TimeZone timezone=utc_timezone);
61 static DateTime get_current_local_time();
64 static DateTime get_current_utc_time();
72 static DateTime from_short_date_string(
const std::string &value);
80 unsigned short get_year()
const;
85 unsigned char get_month()
const;
86 unsigned char get_day()
const;
87 unsigned char get_hour()
const;
88 unsigned char get_minutes()
const;
89 unsigned char get_seconds()
const;
90 unsigned int get_nanoseconds()
const;
91 TimeZone get_timezone()
const;
96 unsigned char get_week()
const;
101 int get_difference_in_days(
const DateTime &other)
const;
106 unsigned int get_day_of_week()
const;
111 static int get_days_in_month(
int month,
int year);
118 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);
119 void set_year(
int year);
120 void set_month(
int month);
121 void set_day(
int day);
122 void set_hour(
int hour);
123 void set_minutes(
int minutes);
124 void set_seconds(
int seconds);
125 void set_nanoseconds(
int nanoseconds);
126 void set_timezone(TimeZone timezone);
144 std::string to_long_date_string()
const;
147 std::string to_short_date_string()
const;
150 std::string to_short_datetime_string()
const;
153 std::string to_long_time_string()
const;
156 std::string to_short_time_string()
const;
159 std::string to_string()
const;
161 bool operator <(
const DateTime &other)
const;
162 bool operator <=(
const DateTime &other)
const;
163 bool operator >(
const DateTime &other)
const;
164 bool operator >=(
const DateTime &other)
const;
165 bool operator ==(
const DateTime &other)
const;
166 bool operator !=(
const DateTime &other)
const;
172 void throw_if_invalid_date(
int year,
int month,
int day,
int hour,
int minute,
int seconds,
int nanoseconds)
const;
173 void throw_if_null()
const;
175 int get_day_number()
const;
176 void set_date_from_daynumber(
int g);
182 unsigned char minute;
183 unsigned char seconds;
184 unsigned int nanoseconds;
187 static const byte64 ticks_from_1601_to_1900;
Date/Time class.
Definition: datetime.h:44
TimeZone
Definition: datetime.h:49
long long byte64
Definition: cl_platform.h:65
Definition: datetime.h:51