Header And Logo

PostgreSQL
| The world's most advanced open source database.

Data Structures | Defines | Typedefs

timestamp.h File Reference

#include <math.h>
#include <limits.h>
#include <float.h>
Include dependency graph for timestamp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Interval

Defines

#define MAX_TIMESTAMP_PRECISION   6
#define MAX_INTERVAL_PRECISION   6
#define TS_PREC_INV   1000000.0
#define TSROUND(j)   (rint(((double) (j)) * TS_PREC_INV) / TS_PREC_INV)
#define DAYS_PER_YEAR   365.25
#define MONTHS_PER_YEAR   12
#define DAYS_PER_MONTH   30
#define HOURS_PER_DAY   24
#define SECS_PER_YEAR   (36525 * 864)
#define SECS_PER_DAY   86400
#define SECS_PER_HOUR   3600
#define SECS_PER_MINUTE   60
#define MINS_PER_HOUR   60
#define USECS_PER_DAY   INT64CONST(86400000000)
#define USECS_PER_HOUR   INT64CONST(3600000000)
#define USECS_PER_MINUTE   INT64CONST(60000000)
#define USECS_PER_SEC   INT64CONST(1000000)
#define MAX_TZDISP_HOUR   15
#define TZDISP_LIMIT   ((MAX_TZDISP_HOUR + 1) * SECS_PER_HOUR)
#define DT_NOBEGIN   (-DBL_MAX)
#define DT_NOEND   (DBL_MAX)
#define TIMESTAMP_NOBEGIN(j)   do {(j) = DT_NOBEGIN;} while (0)
#define TIMESTAMP_IS_NOBEGIN(j)   ((j) == DT_NOBEGIN)
#define TIMESTAMP_NOEND(j)   do {(j) = DT_NOEND;} while (0)
#define TIMESTAMP_IS_NOEND(j)   ((j) == DT_NOEND)
#define TIMESTAMP_NOT_FINITE(j)   (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
#define JULIAN_MINYEAR   (-4713)
#define JULIAN_MINMONTH   (11)
#define JULIAN_MINDAY   (24)
#define JULIAN_MAXYEAR   (5874898)
#define IS_VALID_JULIAN(y, m, d)
#define JULIAN_MAX   (2147483494)
#define UNIX_EPOCH_JDATE   2440588
#define POSTGRES_EPOCH_JDATE   2451545

Typedefs

typedef double Timestamp
typedef double TimestampTz
typedef double TimeOffset
typedef double fsec_t

Define Documentation

#define DAYS_PER_MONTH   30
#define DAYS_PER_YEAR   365.25

Definition at line 80 of file timestamp.h.

Referenced by convert_timevalue_to_scalar(), interval_part(), and interval_reltime().

#define DT_NOBEGIN   (-DBL_MAX)

Definition at line 129 of file timestamp.h.

Referenced by leftmostvalue_timestamp(), and tstz_to_ts_gmt().

#define DT_NOEND   (DBL_MAX)

Definition at line 130 of file timestamp.h.

#define HOURS_PER_DAY   24
#define IS_VALID_JULIAN (   y,
  m,
  d 
)
Value:
(((y) > JULIAN_MINYEAR \
      || ((y) == JULIAN_MINYEAR && \
          ((m) > JULIAN_MINMONTH \
           || ((m) == JULIAN_MINMONTH && (d) >= JULIAN_MINDAY)))) \
     && (y) < JULIAN_MAXYEAR)

Definition at line 160 of file timestamp.h.

Referenced by date_in(), DetermineTimeZoneOffset(), tm2timestamp(), and to_date().

#define JULIAN_MAX   (2147483494)

Definition at line 167 of file timestamp.h.

Referenced by date_recv().

#define JULIAN_MAXYEAR   (5874898)

Definition at line 158 of file timestamp.h.

#define JULIAN_MINDAY   (24)

Definition at line 157 of file timestamp.h.

#define JULIAN_MINMONTH   (11)

Definition at line 156 of file timestamp.h.

#define JULIAN_MINYEAR   (-4713)

Definition at line 155 of file timestamp.h.

#define MAX_INTERVAL_PRECISION   6
#define MAX_TIMESTAMP_PRECISION   6
#define MAX_TZDISP_HOUR   15

Definition at line 115 of file timestamp.h.

Referenced by DecodeTimezone().

#define MINS_PER_HOUR   60
#define MONTHS_PER_YEAR   12
#define POSTGRES_EPOCH_JDATE   2451545
#define SECS_PER_DAY   86400
#define SECS_PER_HOUR   3600
#define SECS_PER_MINUTE   60
#define SECS_PER_YEAR   (36525 * 864)

Definition at line 97 of file timestamp.h.

Referenced by reltimein().

#define TIMESTAMP_IS_NOBEGIN (   j  )     ((j) == DT_NOBEGIN)
#define TIMESTAMP_IS_NOEND (   j  )     ((j) == DT_NOEND)
#define TIMESTAMP_NOBEGIN (   j  )     do {(j) = DT_NOBEGIN;} while (0)
#define TIMESTAMP_NOEND (   j  )     do {(j) = DT_NOEND;} while (0)
#define TIMESTAMP_NOT_FINITE (   j  )     (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
#define TS_PREC_INV   1000000.0

Definition at line 72 of file timestamp.h.

#define TSROUND (   j  )     (rint(((double) (j)) * TS_PREC_INV) / TS_PREC_INV)

Definition at line 73 of file timestamp.h.

Referenced by interval2tm(), interval_div(), interval_mul(), and timestamp2tm().

#define TZDISP_LIMIT   ((MAX_TZDISP_HOUR + 1) * SECS_PER_HOUR)

Definition at line 116 of file timestamp.h.

Referenced by timetz_recv().

#define UNIX_EPOCH_JDATE   2440588
#define USECS_PER_DAY   INT64CONST(86400000000)
#define USECS_PER_HOUR   INT64CONST(3600000000)

Definition at line 104 of file timestamp.h.

Referenced by AdjustIntervalForTypmod().

#define USECS_PER_MINUTE   INT64CONST(60000000)

Definition at line 105 of file timestamp.h.

Referenced by AdjustIntervalForTypmod().

#define USECS_PER_SEC   INT64CONST(1000000)

Typedef Documentation

typedef double fsec_t

Definition at line 53 of file timestamp.h.

typedef double TimeOffset

Definition at line 52 of file timestamp.h.

typedef double Timestamp

Definition at line 50 of file timestamp.h.

typedef double TimestampTz

Definition at line 51 of file timestamp.h.