#include "postgres_fe.h"
#include <time.h>
#include <ctype.h>
#include <math.h>
#include "common/string.h"
#include "dt.h"
#include "pgtypes_timestamp.h"
#include "pgtypeslib_extern.h"
Go to the source code of this file.
Definition at line 18 of file dt_common.c.
Definition at line 973 of file dt_common.c.
References MAXTZLEN, PGTYPES_TS_BAD_TIMESTAMP, SECS_PER_HOUR, strlcpy(), TIMEZONE_GLOBAL, tm, pg_tm::tm_gmtoff, pg_tm::tm_hour, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, pg_tm::tm_zone, and TZNAME_GLOBAL.
Referenced by GetCurrentDateTime().
Definition at line 581 of file dt_common.c.
References y.
Referenced by DecodeDateTime(), DecodeNumber(), and EncodeDateTime().
Definition at line 502 of file dt_common.c.
References sort-test::key, and TOKMAXLEN.
Referenced by DecodeSpecial(), and DecodeUnits().
Definition at line 1308 of file dt_common.c.
References ADBC, BC, DecodeNumber(), DecodeSpecial(), DOY, DTK_DATE_M, DTK_M, i, IGNORE_DTF, len, MAXDATEFIELDS, MONTH, str, tm, pg_tm::tm_mon, pg_tm::tm_year, type, TZ, and val.
Referenced by DecodeDateTime().
Definition at line 1782 of file dt_common.c.
References ADBC, AM, AMPM, BC, date2j(), DAY, day_tab, DecodeDate(), DecodeNumber(), DecodeNumberField(), DecodePosixTimezone(), DecodeSpecial(), DecodeTime(), DecodeTimezone(), DOW, dt2time(), DTK_DATE, DTK_DATE_M, DTK_DAY, DTK_HOUR, DTK_JULIAN, DTK_M, DTK_MINUTE, DTK_MONTH, DTK_NOW, DTK_NUMBER, DTK_SECOND, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TIME_M, DTK_TODAY, DTK_TOMORROW, DTK_TZ, DTK_YEAR, DTK_YESTERDAY, DTK_ZULU, DTZ, DTZMOD, GetCurrentDateTime(), HOUR, HR24, i, IGNORE_DTF, isleap, ISOTIME, j2date(), MINUTE, MONTH, PM, RESERV, SECOND, strtoint(), tm, pg_tm::tm_hour, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_wday, pg_tm::tm_year, type, TZ, UNITS, USECS_PER_DAY, val, value, and YEAR.
Definition at line 1199 of file dt_common.c.
References date2j(), DAY, DecodeNumberField(), DOY, DTK_DATE_M, DTK_M, j2date(), MONTH, MONTHS_PER_YEAR, str, strtoint(), tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_yday, pg_tm::tm_year, val, and YEAR.
Referenced by DecodeDate(), and DecodeDateTime().
Definition at line 1089 of file dt_common.c.
References DTK_DATE, DTK_DATE_M, DTK_TIME, DTK_TIME_M, i, len, str, strtoint(), tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, and pg_tm::tm_year.
Referenced by DecodeDateTime(), and DecodeNumber().
Definition at line 1547 of file dt_common.c.
References DecodeSpecial(), DecodeTimezone(), DTZ, MAXDATEFIELDS, str, type, TZ, and val.
Referenced by DecodeDateTime().
Definition at line 635 of file dt_common.c.
References datebsearch(), datecache, datetktbl, szdatetktbl, TOKMAXLEN, type, datetkn::type, UNKNOWN_FIELD, val, and datetkn::value.
Referenced by DecodeDate(), DecodeDateTime(), and DecodePosixTimezone().
Definition at line 1437 of file dt_common.c.
References DTK_TIME_M, i, str, strtoint(), tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, and USECS_PER_SEC.
Referenced by DecodeDateTime().
Definition at line 1502 of file dt_common.c.
References len, MINS_PER_HOUR, SECS_PER_MINUTE, str, and strtoint().
Referenced by DecodeDateTime(), DecodePosixTimezone(), and PGTYPEStimestamp_defmt_scan().
Definition at line 536 of file dt_common.c.
References datebsearch(), deltacache, deltatktbl, szdeltatktbl, TOKMAXLEN, type, datetkn::type, UNKNOWN_FIELD, val, and datetkn::value.
Definition at line 1068 of file dt_common.c.
References USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by DecodeDateTime().
Definition at line 669 of file dt_common.c.
References Assert(), MONTHS_PER_YEAR, sprintf, str, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, USE_GERMAN_DATES, USE_ISO_DATES, USE_POSTGRES_DATES, and USE_SQL_DATES.
Definition at line 753 of file dt_common.c.
References date2j(), days, MAXTZLEN, MINS_PER_HOUR, months, SECS_PER_HOUR, sprintf, str, tm, pg_tm::tm_hour, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_wday, pg_tm::tm_year, TrimTrailingZeros(), USE_GERMAN_DATES, USE_ISO_DATES, USE_POSTGRES_DATES, and USE_SQL_DATES.
Definition at line 2354 of file dt_common.c.
References str.
Referenced by pgtypes_defmt_scan().
Definition at line 1060 of file dt_common.c.
References abstime2tm(), and tm.
Referenced by DecodeDateTime().
Definition at line 949 of file dt_common.c.
References epoch, tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, and pg_tm::tm_year.
Definition at line 606 of file dt_common.c.
References y.
Referenced by DecodeDateTime(), and DecodeNumber().
Definition at line 1600 of file dt_common.c.
References DTK_DATE, DTK_NUMBER, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TZ, MAXDATEFIELDS, and pg_tolower().
Definition at line 2459 of file dt_common.c.
References err(), find_end_token(), un_fmt_comb::luint_val, pgtypes_strdup(), PGTYPES_TYPE_STRING_MALLOCED, PGTYPES_TYPE_UINT, PGTYPES_TYPE_UINT_LONG, un_fmt_comb::str_val, and un_fmt_comb::uint_val.
Referenced by PGTYPEStimestamp_defmt_scan().
Definition at line 2521 of file dt_common.c.
References datetktbl, day_tab, days, DecodeTimezone(), DTZ, err(), free, isleap, j, un_fmt_comb::luint_val, months, MONTHS_PER_YEAR, pg_strcasecmp(), pgtypes_alloc(), pgtypes_date_months, pgtypes_date_weekdays_short, pgtypes_defmt_scan(), PGTYPES_TYPE_STRING_MALLOCED, PGTYPES_TYPE_UINT, PGTYPES_TYPE_UINT_LONG, PGTYPEStimestamp_defmt_scan(), str, un_fmt_comb::str_val, szdatetktbl, tm, tm2timestamp(), pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, type, TZ, un_fmt_comb::uint_val, and datetkn::value.
Referenced by PGTYPEStimestamp_defmt_asc(), and PGTYPEStimestamp_defmt_scan().
Definition at line 722 of file dt_common.c.
Referenced by AppendSeconds(), and EncodeDateTime().
Definition at line 489 of file dt_common.c.
Referenced by DecodeSpecial().
Definition at line 20 of file dt_common.c.
Referenced by DecodeSpecial(), and PGTYPEStimestamp_defmt_scan().
Definition at line 14 of file dt_common.c.
Referenced by DecodeDateTime(), and PGTYPEStimestamp_defmt_scan().
Definition at line 495 of file dt_common.c.
Referenced by EncodeDateTime(), and PGTYPEStimestamp_defmt_scan().
Definition at line 491 of file dt_common.c.
Referenced by DecodeUnits().
Definition at line 421 of file dt_common.c.
Referenced by DecodeUnits().
Definition at line 493 of file dt_common.c.
Referenced by EncodeDateTime(), and PGTYPEStimestamp_defmt_scan().
Definition at line 499 of file dt_common.c.
Referenced by dttofmtasc_replace(), PGTYPESdate_defmt_asc(), and PGTYPEStimestamp_defmt_scan().
Definition at line 497 of file dt_common.c.
Referenced by dttofmtasc_replace(), PGTYPESdate_fmt_asc(), and PGTYPEStimestamp_defmt_scan().
Definition at line 486 of file dt_common.c.
Referenced by DecodeSpecial(), and PGTYPEStimestamp_defmt_scan().
Definition at line 487 of file dt_common.c.
Referenced by DecodeUnits().