Eneboo - Documentación para desarrolladores
Clases | 'defines' | Funciones | Variables
Referencia del Archivo src/libpq/include/utils/datetime.h
#include <limits.h>
#include <math.h>
#include "utils/timestamp.h"

Ir al código fuente de este archivo.

Clases

struct  datetkn

'defines'

#define DAGO   "ago"
#define DCURRENT   "current"
#define EPOCH   "epoch"
#define INVALID   "invalid"
#define EARLY   "-infinity"
#define LATE   "infinity"
#define NOW   "now"
#define TODAY   "today"
#define TOMORROW   "tomorrow"
#define YESTERDAY   "yesterday"
#define ZULU   "zulu"
#define DMICROSEC   "usecond"
#define DMILLISEC   "msecond"
#define DSECOND   "second"
#define DMINUTE   "minute"
#define DHOUR   "hour"
#define DDAY   "day"
#define DWEEK   "week"
#define DMONTH   "month"
#define DQUARTER   "quarter"
#define DYEAR   "year"
#define DDECADE   "decade"
#define DCENTURY   "century"
#define DMILLENNIUM   "millennium"
#define DA_D   "ad"
#define DB_C   "bc"
#define DTIMEZONE   "timezone"
#define AM   0
#define PM   1
#define HR24   2
#define AD   0
#define BC   1
#define RESERV   0
#define MONTH   1
#define YEAR   2
#define DAY   3
#define JULIAN   4
#define TZ   5
#define DTZ   6
#define DTZMOD   7
#define IGNORE_DTF   8
#define AMPM   9
#define HOUR   10
#define MINUTE   11
#define SECOND   12
#define DOY   13
#define DOW   14
#define UNITS   15
#define ADBC   16
#define AGO   17
#define ABS_BEFORE   18
#define ABS_AFTER   19
#define ISODATE   20
#define ISOTIME   21
#define UNKNOWN_FIELD   31
#define DTK_NUMBER   0
#define DTK_STRING   1
#define DTK_DATE   2
#define DTK_TIME   3
#define DTK_TZ   4
#define DTK_AGO   5
#define DTK_SPECIAL   6
#define DTK_INVALID   7
#define DTK_CURRENT   8
#define DTK_EARLY   9
#define DTK_LATE   10
#define DTK_EPOCH   11
#define DTK_NOW   12
#define DTK_YESTERDAY   13
#define DTK_TODAY   14
#define DTK_TOMORROW   15
#define DTK_ZULU   16
#define DTK_DELTA   17
#define DTK_SECOND   18
#define DTK_MINUTE   19
#define DTK_HOUR   20
#define DTK_DAY   21
#define DTK_WEEK   22
#define DTK_MONTH   23
#define DTK_QUARTER   24
#define DTK_YEAR   25
#define DTK_DECADE   26
#define DTK_CENTURY   27
#define DTK_MILLENNIUM   28
#define DTK_MILLISEC   29
#define DTK_MICROSEC   30
#define DTK_JULIAN   31
#define DTK_DOW   32
#define DTK_DOY   33
#define DTK_TZ_HOUR   34
#define DTK_TZ_MINUTE   35
#define DTK_M(t)   (0x01 << (t))
#define DTK_DATE_M   (DTK_M(YEAR) | DTK_M(MONTH) | DTK_M(DAY))
#define DTK_TIME_M   (DTK_M(HOUR) | DTK_M(MINUTE) | DTK_M(SECOND))
#define MAXDATELEN   51
#define MAXDATEFIELDS   25
#define TOKMAXLEN   10
#define FMODULO(t, q, u)
#define TMODULO(t, q, u)
#define isleap(y)   (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
#define JULIAN_MINYEAR   (-4713)
#define JULIAN_MINMONTH   (11)
#define JULIAN_MINDAY   (24)
#define JULIAN_MAXYEAR   (5874898)
#define IS_VALID_JULIAN(y, m, d)
#define UNIX_EPOCH_JDATE   2440588
#define POSTGRES_EPOCH_JDATE   2451545
#define DTERR_BAD_FORMAT   (-1)
#define DTERR_FIELD_OVERFLOW   (-2)
#define DTERR_MD_FIELD_OVERFLOW   (-3)
#define DTERR_INTERVAL_OVERFLOW   (-4)
#define DTERR_TZDISP_OVERFLOW   (-5)

Funciones

void GetCurrentDateTime (struct pg_tm *tm)
void GetCurrentTimeUsec (struct pg_tm *tm, fsec_t *fsec, int *tzp)
void j2date (int jd, int *year, int *month, int *day)
int date2j (int year, int month, int day)
int ParseDateTime (const char *timestr, char *workbuf, size_t buflen, char **field, int *ftype, int maxfields, int *numfields)
int DecodeDateTime (char **field, int *ftype, int nf, int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp)
int DecodeTimeOnly (char **field, int *ftype, int nf, int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp)
int DecodeInterval (char **field, int *ftype, int nf, int *dtype, struct pg_tm *tm, fsec_t *fsec)
void DateTimeParseError (int dterr, const char *str, const char *datatype)
int DetermineTimeZoneOffset (struct pg_tm *tm, pg_tz *tzp)
int EncodeDateOnly (struct pg_tm *tm, int style, char *str)
int EncodeTimeOnly (struct pg_tm *tm, fsec_t fsec, int *tzp, int style, char *str)
int EncodeDateTime (struct pg_tm *tm, fsec_t fsec, int *tzp, char **tzn, int style, char *str)
int EncodeInterval (struct pg_tm *tm, fsec_t fsec, int style, char *str)
int DecodeSpecial (int field, char *lowtoken, int *val)
int DecodeUnits (int field, char *lowtoken, int *val)
int j2day (int jd)
bool CheckDateTokenTables (void)

Variables

const int day_tab [2][13]

Documentación de los 'defines'

#define ABS_AFTER   19
#define ABS_BEFORE   18
#define AD   0
#define ADBC   16
#define AGO   17
#define AM   0
#define AMPM   9
#define BC   1
#define DA_D   "ad"
#define DAGO   "ago"
#define DAY   3
#define DB_C   "bc"
#define DCENTURY   "century"
#define DCURRENT   "current"
#define DDAY   "day"
#define DDECADE   "decade"
#define DHOUR   "hour"
#define DMICROSEC   "usecond"
#define DMILLENNIUM   "millennium"
#define DMILLISEC   "msecond"
#define DMINUTE   "minute"
#define DMONTH   "month"
#define DOW   14
#define DOY   13
#define DQUARTER   "quarter"
#define DSECOND   "second"
#define DTERR_BAD_FORMAT   (-1)
#define DTERR_FIELD_OVERFLOW   (-2)
#define DTERR_INTERVAL_OVERFLOW   (-4)
#define DTERR_MD_FIELD_OVERFLOW   (-3)
#define DTERR_TZDISP_OVERFLOW   (-5)
#define DTIMEZONE   "timezone"
#define DTK_AGO   5
#define DTK_CENTURY   27
#define DTK_CURRENT   8
#define DTK_DATE   2
#define DTK_DATE_M   (DTK_M(YEAR) | DTK_M(MONTH) | DTK_M(DAY))
#define DTK_DAY   21
#define DTK_DECADE   26
#define DTK_DELTA   17
#define DTK_DOW   32
#define DTK_DOY   33
#define DTK_EARLY   9
#define DTK_EPOCH   11
#define DTK_HOUR   20
#define DTK_INVALID   7
#define DTK_JULIAN   31
#define DTK_LATE   10
#define DTK_M (   t)    (0x01 << (t))
#define DTK_MICROSEC   30
#define DTK_MILLENNIUM   28
#define DTK_MILLISEC   29
#define DTK_MINUTE   19
#define DTK_MONTH   23
#define DTK_NOW   12
#define DTK_NUMBER   0
#define DTK_QUARTER   24
#define DTK_SECOND   18
#define DTK_SPECIAL   6
#define DTK_STRING   1
#define DTK_TIME   3
#define DTK_TIME_M   (DTK_M(HOUR) | DTK_M(MINUTE) | DTK_M(SECOND))
#define DTK_TODAY   14
#define DTK_TOMORROW   15
#define DTK_TZ   4
#define DTK_TZ_HOUR   34
#define DTK_TZ_MINUTE   35
#define DTK_WEEK   22
#define DTK_YEAR   25
#define DTK_YESTERDAY   13
#define DTK_ZULU   16
#define DTZ   6
#define DTZMOD   7
#define DWEEK   "week"
#define DYEAR   "year"
#define EARLY   "-infinity"
#define EPOCH   "epoch"
#define FMODULO (   t,
  q,
  u 
)
Valor:
do { \
        (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
        if ((q) != 0) (t) -= rint((q) * (u)); \
} while(0)
#define HOUR   10
#define HR24   2
#define IGNORE_DTF   8
#define INVALID   "invalid"
#define IS_VALID_JULIAN (   y,
  m,
 
)
Valor:
((((y) > JULIAN_MINYEAR) \
  || (((y) == JULIAN_MINYEAR) && (((m) > JULIAN_MINMONTH) \
  || (((m) == JULIAN_MINMONTH) && ((d) >= JULIAN_MINDAY))))) \
 && ((y) < JULIAN_MAXYEAR))
#define isleap (   y)    (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
#define ISODATE   20
#define ISOTIME   21
#define JULIAN   4
#define JULIAN_MAXYEAR   (5874898)
#define JULIAN_MINDAY   (24)
#define JULIAN_MINMONTH   (11)
#define JULIAN_MINYEAR   (-4713)
#define LATE   "infinity"
#define MAXDATEFIELDS   25
#define MAXDATELEN   51
#define MINUTE   11
#define MONTH   1
#define NOW   "now"
#define PM   1
#define POSTGRES_EPOCH_JDATE   2451545
#define RESERV   0
#define SECOND   12
#define TMODULO (   t,
  q,
  u 
)
Valor:
do { \
        (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
        if ((q) != 0) (t) -= rint((q) * (u)); \
} while(0)
#define TODAY   "today"
#define TOKMAXLEN   10
#define TOMORROW   "tomorrow"
#define TZ   5
#define UNITS   15
#define UNIX_EPOCH_JDATE   2440588
#define UNKNOWN_FIELD   31
#define YEAR   2
#define YESTERDAY   "yesterday"
#define ZULU   "zulu"

Documentación de las funciones

bool CheckDateTokenTables ( void  )
int date2j ( int  year,
int  month,
int  day 
)
void DateTimeParseError ( int  dterr,
const char *  str,
const char *  datatype 
)
int DecodeDateTime ( char **  field,
int ftype,
int  nf,
int dtype,
struct pg_tm *  tm,
fsec_t fsec,
int tzp 
)
int DecodeInterval ( char **  field,
int ftype,
int  nf,
int dtype,
struct pg_tm *  tm,
fsec_t fsec 
)
int DecodeSpecial ( int  field,
char *  lowtoken,
int val 
)
int DecodeTimeOnly ( char **  field,
int ftype,
int  nf,
int dtype,
struct pg_tm *  tm,
fsec_t fsec,
int tzp 
)
int DecodeUnits ( int  field,
char *  lowtoken,
int val 
)
int DetermineTimeZoneOffset ( struct pg_tm *  tm,
pg_tz *  tzp 
)
int EncodeDateOnly ( struct pg_tm *  tm,
int  style,
char *  str 
)
int EncodeDateTime ( struct pg_tm *  tm,
fsec_t  fsec,
int tzp,
char **  tzn,
int  style,
char *  str 
)
int EncodeInterval ( struct pg_tm *  tm,
fsec_t  fsec,
int  style,
char *  str 
)
int EncodeTimeOnly ( struct pg_tm *  tm,
fsec_t  fsec,
int tzp,
int  style,
char *  str 
)
void GetCurrentDateTime ( struct pg_tm *  tm)
void GetCurrentTimeUsec ( struct pg_tm *  tm,
fsec_t fsec,
int tzp 
)
void j2date ( int  jd,
int year,
int month,
int day 
)
int j2day ( int  jd)
int ParseDateTime ( const char *  timestr,
char *  workbuf,
size_t  buflen,
char **  field,
int ftype,
int  maxfields,
int numfields 
)

Documentación de las variables

const int day_tab[2][13]
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'