11#error -ffast-math is known to break this code
56 *result =
dt2local(*result, -(*tzp));
97#if defined(HAVE_STRUCT_TM_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
131#if defined(HAVE_STRUCT_TM_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
145#if defined(HAVE_STRUCT_TM_TM_ZONE)
152#elif defined(HAVE_INT_TIMEZONE)
420 const char *
fmt =
"%G";
442 const char *
fmt =
"%g";
601 const char *
fmt =
"%V";
644 const char *
fmt =
"%x";
821 fmt =
"%Y-%m-%d %H:%M:%S";
864 if (
span->month != 0)
int ParseDateTime(const char *timestr, char *workbuf, size_t buflen, char **field, int *ftype, int maxfields, int *numfields)
void j2date(int jd, int *year, int *month, int *day)
void GetCurrentDateTime(struct pg_tm *tm)
void EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str)
const char *const months[]
int DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp, DateTimeErrorExtra *extra)
int date2j(int year, int month, int day)
void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec)
void GetEpochTime(struct pg_tm *tm)
void EncodeSpecialTimestamp(Timestamp dt, char *str)
static Timestamp dt2local(Timestamp dt, int timezone)
static TimeOffset time2t(const int hour, const int min, const int sec, const fsec_t fsec)
#define TIMESTAMP_NOBEGIN(j)
#define IS_VALID_JULIAN(y, m, d)
#define IS_VALID_TIMESTAMP(t)
#define TIMESTAMP_IS_NOEND(j)
#define TIMESTAMP_IS_NOBEGIN(j)
#define TIMESTAMP_NOT_FINITE(j)
#define TIMESTAMP_NOEND(j)
int PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp *d, int *year, int *month, int *day, int *hour, int *minute, int *second, int *tz)
#define IS_VALID_UTIME(y, m, d)
char * pgtypes_date_months[]
char * pgtypes_date_weekdays_short[]
static bool pg_mul_s64_overflow(int64 a, int64 b, int64 *result)
static bool pg_add_s64_overflow(int64 a, int64 b, int64 *result)
char * pgtypes_strdup(const char *str)
int pgtypes_fmt_replace(union un_fmt_comb replace_val, int replace_type, char **output, int *pstr_len)
static int timestamp2tm(timestamp dt, int *tzp, struct tm *tm, fsec_t *fsec, const char **tzn)
int PGTYPEStimestamp_sub_interval(timestamp *tin, interval *span, timestamp *tout)
timestamp PGTYPEStimestamp_from_asc(char *str, char **endptr)
int PGTYPEStimestamp_sub(timestamp *ts1, timestamp *ts2, interval *iv)
int PGTYPEStimestamp_add_interval(timestamp *tin, interval *span, timestamp *tout)
static timestamp SetEpochTimestamp(void)
char * PGTYPEStimestamp_to_asc(timestamp tstamp)
void PGTYPEStimestamp_current(timestamp *ts)
int PGTYPEStimestamp_fmt_asc(timestamp *ts, char *output, int str_len, const char *fmtstr)
int PGTYPEStimestamp_defmt_asc(const char *str, const char *fmt, timestamp *d)
int tm2timestamp(struct tm *tm, fsec_t fsec, int *tzp, timestamp *result)
static int dttofmtasc_replace(timestamp *ts, date dDate, int dow, struct tm *tm, char *output, int *pstr_len, const char *fmtstr)
static char buf[DEFAULT_XLOG_SEG_SIZE]
date PGTYPESdate_from_timestamp(timestamp dt)
int PGTYPESdate_dayofweek(date dDate)
#define PGTYPES_TS_BAD_TIMESTAMP
#define PGTYPES_TS_ERR_EINFTIME
#define PGTYPES_TYPE_STRING_CONSTANT
#define PGTYPES_TYPE_NOTHING
#define PGTYPES_TYPE_UINT
#define PGTYPES_TYPE_CHAR
#define PGTYPES_TYPE_UINT_2_LS
#define PGTYPES_TYPE_UINT_2_LZ
#define PGTYPES_TYPE_INT64
#define PGTYPES_TYPE_UINT_3_LZ
static void fmtstr(const char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)