39 #include <boost/foreach.hpp>
40 #include <drizzled/charset.h>
41 #include <drizzled/type/decimal.h>
45 #include <drizzled/time_functions.h>
48 #include <drizzled/util/gmtime.h>
60 extern std::vector<TemporalFormat *> known_datetime_formats;
61 extern std::vector<TemporalFormat *> known_date_formats;
62 extern std::vector<TemporalFormat *> known_time_formats;
64 Temporal::Temporal() :
80 return (uint64_t) ((_hours * INT64_C(3600))
81 + (_minutes * INT64_C(60))
85 #if defined(TARGET_OS_SOLARIS)
87 static time_t timegm(
struct tm *my_time)
89 time_t local_secs, gm_secs;
90 struct tm gm__rec, *gm_time;
93 local_secs = mktime(my_time);
97 local_secs = mktime (my_time);
104 gm_time = util::gmtime(local_secs, &gm__rec);
105 gm_time->tm_isdst = 0;
108 gm_secs = mktime (gm_time);
112 gm_secs = mktime (gm_time);
119 return (local_secs - (gm_secs - local_secs));
132 struct tm broken_time;
134 broken_time.tm_sec= _seconds;
135 broken_time.tm_min= _minutes;
136 broken_time.tm_hour= _hours;
137 broken_time.tm_mday= _days;
138 broken_time.tm_mon= _months - 1;
139 broken_time.tm_year= _years - 1900;
141 result_time= timegm(&broken_time);
143 _epoch_seconds= result_time;
152 if (not it->
matches(from, from_len,
this))
164 if (not it->
matches(from, from_len,
this))
182 && _minutes == rhs._minutes
183 && _seconds == rhs._seconds
184 && _useconds == rhs._useconds
185 && _nseconds == rhs._nseconds
188 bool Time::operator!=(
const Time& rhs)
190 return ! (*
this == rhs);
192 bool Time::operator<(
const Time& rhs)
196 bool Time::operator<=(
const Time& rhs)
200 bool Time::operator>(
const Time& rhs)
204 bool Time::operator>=(
const Time& rhs)
236 result._hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
237 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
238 result._minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
239 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
240 result._seconds= (uint32_t) second_diff;
248 result._hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
249 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
250 result._minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
251 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
252 result._seconds= (uint32_t) second_diff;
267 _hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
268 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
269 _minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
270 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
271 _seconds= (uint32_t) second_diff;
281 _hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
282 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
283 _minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
284 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
285 _seconds= (uint32_t) second_diff;
302 && _months == rhs._months
303 && _days == rhs._days
306 bool Date::operator!=(
const Date& rhs)
308 return ! (*
this == rhs);
310 bool Date::operator<(
const Date& rhs)
314 return (days_left < days_right);
316 bool Date::operator<=(
const Date& rhs)
320 return (days_left <= days_right);
322 bool Date::operator>(
const Date& rhs)
324 return ! (*
this <= rhs);
326 bool Date::operator>=(
const Date& rhs)
328 return ! (*
this < rhs);
340 && _months == rhs._months
341 && _days == rhs._days
342 && _hours == rhs._hours
343 && _minutes == rhs._minutes
344 && _seconds == rhs._seconds
345 && _useconds == rhs._useconds
346 && _nseconds == rhs._nseconds
349 bool Date::operator!=(
const DateTime& rhs)
351 return ! (*
this == rhs);
353 bool Date::operator<(
const DateTime& rhs)
357 if (days_left < days_right)
359 else if (days_left > days_right)
364 bool Date::operator<=(
const DateTime& rhs)
368 if (days_left < days_right)
370 else if (days_left > days_right)
375 bool Date::operator>(
const DateTime& rhs)
377 return ! (*
this <= rhs);
379 bool Date::operator>=(
const DateTime& rhs)
381 return ! (*
this < rhs);
397 result._years= _years;
398 result._months= _months;
415 result._hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
416 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
417 result._minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
418 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
419 result._seconds= (uint32_t) second_diff;
422 int64_t microsecond_diff= _useconds - rhs._useconds;
423 if (microsecond_diff < 0)
425 microsecond_diff= (-1 * microsecond_diff);
428 result._useconds= (uint32_t) microsecond_diff;
441 result._years= _years;
442 result._months= _months;
451 if (second_diff >= DRIZZLE_SECONDS_IN_DAY)
454 second_diff%= DRIZZLE_SECONDS_IN_DAY;
457 result._hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
458 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
459 result._minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
460 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
461 result._seconds= (uint32_t) second_diff;
464 int64_t microsecond_diff= _useconds - rhs._useconds;
465 if (microsecond_diff < 0)
467 microsecond_diff= (-1 * microsecond_diff);
470 result._useconds= (uint32_t) microsecond_diff;
486 if (second_diff >= DRIZZLE_SECONDS_IN_DAY)
489 second_diff%= DRIZZLE_SECONDS_IN_DAY;
492 _hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
493 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
494 _minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
495 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
496 _seconds= (uint32_t) second_diff;
499 int64_t microsecond_diff= _useconds - rhs._useconds;
500 if (microsecond_diff < 0)
502 microsecond_diff= (-1 * microsecond_diff);
505 _useconds= (uint32_t) microsecond_diff;
529 _hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
530 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
531 _minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
532 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
533 _seconds= (uint32_t) second_diff;
536 int64_t microsecond_diff= _useconds - rhs._useconds;
537 if (microsecond_diff < 0)
539 microsecond_diff= (-1 * microsecond_diff);
542 _useconds= (uint32_t) microsecond_diff;
559 int64_t day_diff= day_left - day_right;
574 int64_t day_diff= day_left + day_right;
584 Date& Date::operator-=(
const Date &rhs)
588 int64_t day_diff= day_left - day_right;
602 int64_t day_diff= day_left + day_right;
615 _months= rhs._months;
618 _hours= _minutes= _seconds= _useconds= _nseconds= 0;
631 int64_t day_diff= day_left - day_right;
653 result._hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
654 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
655 result._minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
656 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
657 result._seconds= (uint32_t) second_diff;
660 int64_t microsecond_diff= _useconds - rhs._useconds;
661 if (microsecond_diff < 0)
663 microsecond_diff= (-1 * microsecond_diff);
666 result._useconds= (uint32_t) microsecond_diff;
678 int64_t day_diff= day_left + day_right;
693 if (second_diff >= DRIZZLE_SECONDS_IN_DAY)
696 second_diff%= DRIZZLE_SECONDS_IN_DAY;
699 result._hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
700 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
701 result._minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
702 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
703 result._seconds= (uint32_t) second_diff;
706 int64_t microsecond_diff= _useconds - rhs._useconds;
707 if (microsecond_diff < 0)
709 microsecond_diff= (-1 * microsecond_diff);
712 result._useconds= (uint32_t) microsecond_diff;
722 int64_t day_diff= day_left - day_right;
743 _hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
744 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
745 _minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
746 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
747 _seconds= (uint32_t) second_diff;
750 int64_t microsecond_diff= _useconds - rhs._useconds;
751 if (microsecond_diff < 0)
753 microsecond_diff= (-1 * microsecond_diff);
756 _useconds= (uint32_t) microsecond_diff;
768 int64_t day_diff= day_left + day_right;
782 if (second_diff >= DRIZZLE_SECONDS_IN_DAY)
785 second_diff%= DRIZZLE_SECONDS_IN_DAY;
788 _hours= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_HOUR;
789 second_diff%= DRIZZLE_SECONDS_IN_HOUR;
790 _minutes= (uint32_t) second_diff / DRIZZLE_SECONDS_IN_MINUTE;
791 second_diff%= DRIZZLE_SECONDS_IN_MINUTE;
792 _seconds= (uint32_t) second_diff;
795 int64_t microsecond_diff= _useconds - rhs._useconds;
796 if (microsecond_diff < 0)
798 microsecond_diff= (-1 * microsecond_diff);
801 _useconds= (uint32_t) microsecond_diff;
811 return (_years == rhs._years && _months == rhs._months && _days == rhs._days);
813 bool Date::operator!=(
const Timestamp& rhs)
815 return ! (*
this == rhs);
817 bool Date::operator<(
const Timestamp& rhs)
819 if (_years < rhs._years)
821 if (_years > rhs._years)
824 if (_months < rhs._months)
826 if (_months > rhs._months)
829 return _days < rhs._days;
831 bool Date::operator<=(
const Timestamp& rhs)
833 return (*
this < rhs || *
this == rhs);
835 bool Date::operator>(
const Timestamp& rhs)
837 return ! (*
this <= rhs);
839 bool Date::operator>=(
const Timestamp& rhs)
841 return ! (*
this < rhs);
848 return (_years == rhs._years && _months == rhs._months && _days == rhs._days);
850 bool Timestamp::operator!=(
const Date& rhs)
852 return ! (*
this == rhs);
854 bool Timestamp::operator<(
const Date& rhs)
856 if (_years < rhs._years)
858 if (_years > rhs._years)
861 if (_months < rhs._months)
863 if (_months > rhs._months)
866 return _days < rhs._days;
868 bool Timestamp::operator<=(
const Date& rhs)
870 return (*
this < rhs || *
this == rhs);
872 bool Timestamp::operator>(
const Date& rhs)
874 return ! (*
this <= rhs);
876 bool Timestamp::operator>=(
const Date& rhs)
878 return ! (*
this < rhs);
885 return (_years == rhs._years && _months == rhs._months && _days == rhs._days
886 && _hours == rhs._hours && _minutes == rhs._minutes && _seconds == rhs._seconds);
888 bool Timestamp::operator!=(
const DateTime& rhs)
890 return ! (*
this == rhs);
892 bool Timestamp::operator<(
const DateTime& rhs)
894 if (_years < rhs._years)
896 if (_years > rhs._years)
899 if (_months < rhs._months)
901 if (_months > rhs._months)
904 if (_days < rhs._days)
906 if (_days > rhs._days)
909 if (_hours < rhs._hours)
911 if (_hours > rhs._hours)
914 if (_minutes < rhs._minutes)
916 if (_minutes > rhs._minutes)
919 return _seconds < rhs._seconds;
921 bool Timestamp::operator<=(
const DateTime& rhs)
923 return (*
this < rhs || *
this == rhs);
925 bool Timestamp::operator>(
const DateTime& rhs)
927 return ! (*
this <= rhs);
929 bool Timestamp::operator>=(
const DateTime& rhs)
931 return ! (*
this < rhs);
938 return (_epoch_seconds == rhs._epoch_seconds);
940 bool Timestamp::operator!=(
const Timestamp& rhs)
942 return ! (*
this == rhs);
944 bool Timestamp::operator<(
const Timestamp& rhs)
946 return (_epoch_seconds < rhs._epoch_seconds);
948 bool Timestamp::operator<=(
const Timestamp& rhs)
950 return (_epoch_seconds <= rhs._epoch_seconds);
952 bool Timestamp::operator>(
const Timestamp& rhs)
954 return ! (*
this <= rhs);
956 bool Timestamp::operator>=(
const Timestamp& rhs)
958 return ! (*
this < rhs);
970 return os << subject.
years() <<
'-'
971 << std::setw(2) << std::setfill(
'0') << subject.
months() <<
'-'
972 << std::setw(2) << std::setfill(
'0') << subject.
days() <<
' '
973 << std::setw(2) << std::setfill(
'0') << subject.
hours() <<
':'
974 << std::setw(2) << std::setfill(
'0') << subject.
minutes() <<
':'
975 << std::setw(2) << std::setfill(
'0') << subject.
seconds();
982 if (not it->
matches(from, from_len,
this))
984 return is_fuzzy_valid();
991 return snprintf(to, to_len,
"%02" PRIu32
":%02" PRIu32
":%02" PRIu32, _hours, _minutes, _seconds);
996 return snprintf(to, to_len,
"%04" PRIu32
"-%02" PRIu32
"-%02" PRIu32, _years, _months, _days);
1004 return snprintf(to, to_len,
1005 "%04" PRIu32
"-%02" PRIu32
"-%02" PRIu32
" %02" PRIu32
":%02" PRIu32
":%02" PRIu32,
1006 _years, _months, _days, _hours, _minutes, _seconds);
1010 return snprintf(to, to_len,
1011 "%04" PRIu32
"-%02" PRIu32
"-%02" PRIu32
" %02" PRIu32
":%02" PRIu32
":%02" PRIu32
".%06" PRIu32,
1012 _years, _months, _days, _hours, _minutes, _seconds, _useconds);
1018 return snprintf(to, to_len,
1019 "%04" PRIu32
"-%02" PRIu32
"-%02" PRIu32
" %02" PRIu32
":%02" PRIu32
":%02" PRIu32
".%06" PRIu32,
1020 _years, _months, _days, _hours, _minutes, _seconds, _useconds);
1025 int64_t time_portion= (((_hours * 100L) + _minutes) * 100L) + _seconds;
1026 (void) int2_class_decimal(E_DEC_FATAL_ERROR, time_portion,
false, to);
1029 to->buf[(to->intg-1) / 9 + 1]= _useconds * 1000;
1036 int64_t date_portion= (((_years * 100L) + _months) * 100L) + _days;
1037 (void) int2_class_decimal(E_DEC_FATAL_ERROR, date_portion,
false, to);
1042 int64_t date_portion= (((_years * 100L) + _months) * 100L) + _days;
1043 int64_t time_portion= (((((date_portion * 100L) + _hours) * 100L) + _minutes) * 100L) + _seconds;
1044 (void) int2_class_decimal(E_DEC_FATAL_ERROR, time_portion,
false, to);
1047 to->buf[(to->intg-1) / 9 + 1]= _useconds * 1000;
1054 *to= (_years * INT32_C(10000)) + (_months * INT32_C(100)) + _days;
1059 *to= (_years * INT32_C(10000)) + (_months * INT32_C(100)) + _days;
1064 *to= (_hours * INT32_C(10000)) + (_minutes * INT32_C(100)) + _seconds;
1070 to= (_hours * 60 * 60) + (_minutes * 60) + _seconds;
1076 (_years * INT64_C(10000))
1077 + (_months * INT64_C(100))
1079 ) * INT64_C(1000000))
1081 (_hours * INT64_C(10000))
1082 + (_minutes * INT64_C(100) )
1093 to->tm_mon= _months - 1;
1094 to->tm_year= _years - 1900;
1099 to->tm_sec= _seconds;
1100 to->tm_min= _minutes;
1101 to->tm_hour= _hours;
1103 to->tm_mon= _months - 1;
1104 to->tm_year= _years - 1900;
1123 return ((
DateTime *)
this)->from_int64_t((int64_t) from);
1132 uint32_t copy_from= (uint32_t) from;
1133 _hours= copy_from / INT32_C(10000);
1134 _minutes= (copy_from % INT32_C(10000)) / INT32_C(100);
1135 _seconds= copy_from % INT32_C(100);
1146 int64_t copy_from= from;
1150 if (copy_from == 0LL)
1153 if (convert && copy_from < 10000101000000LL)
1155 if (copy_from < 101)
1157 else if (copy_from <= (DRIZZLE_YY_PART_YEAR-1)*10000L+1231L)
1158 copy_from= (copy_from+20000000L)*1000000L;
1159 else if (copy_from < (DRIZZLE_YY_PART_YEAR)*10000L+101L)
1161 else if (copy_from <= 991231L)
1162 copy_from= (copy_from+19000000L)*1000000L;
1163 else if (copy_from < 10000101L)
1165 else if (copy_from <= 99991231L)
1166 copy_from= copy_from*1000000L;
1167 else if (copy_from < 101000000L)
1169 else if (copy_from <= (DRIZZLE_YY_PART_YEAR-1) * 10000000000LL + 1231235959LL)
1170 copy_from= copy_from + 20000000000000LL;
1171 else if (copy_from < DRIZZLE_YY_PART_YEAR * 10000000000LL + 101000000LL)
1173 else if (copy_from <= 991231235959LL)
1174 copy_from= copy_from + 19000000000000LL;
1177 part1= (int64_t) (copy_from / 1000000LL);
1178 part2= (int64_t) (copy_from - (int64_t) part1 * 1000000LL);
1179 _years= (uint32_t) (part1/10000L);
1182 _months= (uint32_t) part1 / 100;
1183 _days= (uint32_t) part1 % 100;
1184 _hours= (uint32_t) (part2/10000L);
1187 _minutes= (uint32_t) part2 / 100;
1188 _seconds= (uint32_t) part2 % 100;
1194 bool Date::in_unix_epoch()
const
1206 _years= 1900 + from->tm_year;
1207 _months= 1 + from->tm_mon;
1208 _days= from->tm_mday;
1209 _hours= from->tm_hour;
1210 _minutes= from->tm_min;
1211 _seconds= from->tm_sec;
1226 struct tm broken_time;
1229 result= util::gmtime(from, &broken_time);
1235 _hours= broken_time.tm_hour;
1236 _minutes= broken_time.tm_min;
1237 _seconds= broken_time.tm_sec;
1250 struct tm broken_time;
1253 result= util::gmtime(from, &broken_time);
1256 _years= 1900 + broken_time.tm_year;
1257 _months= 1 + broken_time.tm_mon;
1258 _days= broken_time.tm_mday;
1272 bool DateTime::from_timeval(
struct timeval &timeval_arg)
1274 struct tm broken_time;
1277 result= util::gmtime(timeval_arg.tv_sec, &broken_time);
1280 _years= 1900 + broken_time.tm_year;
1281 _months= 1 + broken_time.tm_mon;
1282 _days= broken_time.tm_mday;
1283 _hours= broken_time.tm_hour;
1284 _minutes= broken_time.tm_min;
1285 _seconds= broken_time.tm_sec;
1286 _epoch_seconds= timeval_arg.tv_sec;
1288 _useconds= timeval_arg.tv_usec;
1300 struct tm broken_time;
1303 result= util::gmtime(from, &broken_time);
1306 _years= 1900 + broken_time.tm_year;
1307 _months= 1 + broken_time.tm_mon;
1308 _days= broken_time.tm_mday;
1309 _hours= broken_time.tm_hour;
1310 _minutes= broken_time.tm_min;
1311 _seconds= broken_time.tm_sec;
1312 _epoch_seconds= from;
1326 if (in_unix_epoch())
1343 to.tv_sec= _epoch_seconds;
1344 to.tv_usec= _useconds;
1349 to->tv_sec= _epoch_seconds;
1350 to->tv_nsec= _nseconds;
1355 return (_years >= DRIZZLE_MIN_YEARS_SQL && _years <= DRIZZLE_MAX_YEARS_SQL)
1356 && (_months >= 1 && _months <= DRIZZLE_MAX_MONTHS)
1362 return (_years == 0)
1365 && (_hours <= DRIZZLE_MAX_HOURS)
1366 && (_minutes <= DRIZZLE_MAX_MINUTES)
1367 && (_seconds <= DRIZZLE_MAX_SECONDS);
1370 bool Time::is_fuzzy_valid()
const
1375 return (_years >= DRIZZLE_MIN_YEARS_SQL && _years <= DRIZZLE_MAX_YEARS_SQL)
1376 && (_months >= 1 && _months <= DRIZZLE_MAX_MONTHS)
1378 && (_hours <= DRIZZLE_MAX_HOURS)
1379 && (_minutes <= DRIZZLE_MAX_MINUTES)
1380 && (_seconds <= DRIZZLE_MAX_SECONDS);
1385 return (_years >= DRIZZLE_MIN_YEARS_SQL && _years <= DRIZZLE_MAX_YEARS_SQL)
1386 && (_months >= 1 && _months <= DRIZZLE_MAX_MONTHS)
1388 && (_hours <= DRIZZLE_MAX_HOURS)
1389 && (_minutes <= DRIZZLE_MAX_MINUTES)
1390 && (_seconds <= DRIZZLE_MAX_SECONDS_WITH_LEAP);
1397 && (_seconds <= DRIZZLE_MAX_SECONDS);
1403 && (_useconds <= UINT32_C(999999));
1409 && (_useconds <= UINT32_C(999999))
1410 && (_nseconds <= UINT32_C(999999999));
virtual int to_string(char *to, size_t to_len) const
bool from_string(const char *from, size_t from_len)
virtual void to_int64_t(int64_t *to) const
bool from_julian_day_number(const int64_t from)
virtual void to_tm(struct tm *to) const
void to_julian_day_number(int64_t *to) const
bool from_string(const char *from, size_t from_len)
uint64_t _cumulative_seconds_in_time() const
uint32_t days_in_gregorian_year_month(uint32_t year, uint32_t month)
void to_uint64_t(uint64_t &to) const
const Date operator+(const Date &rhs)
Date & operator+=(const Date &rhs)
void to_timeval(struct timeval &to) const
bool from_time_t(const time_t from)
virtual bool from_tm(const struct tm *from)
TODO: Rename this file - func.h is stupid.
virtual void to_int32_t(int32_t *to) const
const Time operator+(const Time &rhs)
std::ostream & operator<<(std::ostream &os, const Timestamp &subject)
bool in_unix_epoch() const
void to_tm(struct tm *to) const
Time & operator-=(const Time &rhs)
const Date operator-(const Date &rhs)
virtual bool from_int32_t(const int32_t from)
virtual void to_decimal(type::Decimal *to) const
int to_string(char *to, size_t to_len) const
int to_string(char *to, size_t to_len) const
virtual int to_string(char *to, size_t to_len) const
void to_int64_t(int64_t *to) const
int64_t julian_day_number_from_gregorian_date(uint32_t year, uint32_t month, uint32_t day)
bool operator==(const Date &rhs)
Time & operator+=(const Time &rhs)
virtual bool from_time_t(const time_t from)
bool from_int64_t(const int64_t from, bool convert)
void to_timespec(struct timespec *to) const
virtual void to_time_t(time_t &to) const
void to_int32_t(int32_t *to) const
Date & operator=(const DateTime &rhs)
void to_time_t(time_t &to) const
virtual bool operator==(const Date &rhs)
void gregorian_date_from_julian_day_number(int64_t julian_day, uint32_t *year_out, uint32_t *month_out, uint32_t *day_out)
bool in_unix_epoch_range(uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second)
bool operator==(const Time &rhs)
virtual bool is_valid() const
const Time operator-(const Time &rhs)
virtual bool is_valid() const
bool from_time_t(const time_t from)
virtual bool is_valid() const
virtual bool from_string(const char *from, size_t from_len)
void to_decimal(type::Decimal *to) const
bool from_int32_t(const int32_t from)
void to_decimal(type::Decimal *to) const