#include <math.h>
#include <limits.h>
#include <float.h>
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 DAYS_PER_MONTH 30 |
Definition at line 89 of file timestamp.h.
Referenced by DecodeInterval(), DecodeISO8601Interval(), interval_cmp_value(), interval_div(), interval_mul(), interval_part(), interval_reltime(), interval_to_char(), and reltime_interval().
#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 |
Definition at line 90 of file timestamp.h.
Referenced by DCH_to_char(), DecodeDateTime(), DecodeTimeOnly(), do_to_timestamp(), interval_cmp_value(), tm2abstime(), and tm2interval().
#define IS_VALID_JULIAN | ( | y, | ||
m, | ||||
d | ||||
) |
(((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 |
Definition at line 66 of file timestamp.h.
Referenced by AdjustIntervalForTypmod(), EncodeInterval(), interval_transform(), and intervaltypmodin().
#define MAX_TIMESTAMP_PRECISION 6 |
Definition at line 65 of file timestamp.h.
Referenced by AdjustTimestampForTypmod(), anytimestamp_typmodin(), AppendTimestampSeconds(), and timestamp_transform().
#define MAX_TZDISP_HOUR 15 |
Definition at line 115 of file timestamp.h.
Referenced by DecodeTimezone().
#define MINS_PER_HOUR 60 |
Definition at line 101 of file timestamp.h.
Referenced by ConvertTimeZoneAbbrevs(), DecodeTime(), DecodeTimeOnly(), DecodeTimezone(), EncodeDateTime(), PGTYPEStimestamp_defmt_scan(), reltimein(), time2t(), timestamp_time(), timestamptz_part(), timestamptz_time(), tm2abstime(), tm2interval(), tm2time(), and tm2timetz().
#define MONTHS_PER_YEAR 12 |
Definition at line 81 of file timestamp.h.
Referenced by AdjustIntervalForTypmod(), convert_timevalue_to_scalar(), DCH_from_char(), DCH_to_char(), DecodeInterval(), DecodeNumber(), EncodeDateOnly(), EncodeDateTime(), interval_to_char(), j2date(), PGTYPESdate_defmt_asc(), PGTYPEStimestamp_add_interval(), PGTYPEStimestamp_defmt_scan(), reltime_interval(), timestamp_pl_interval(), timestamp_trunc(), timestamptz_pl_interval(), timestamptz_trunc(), tm2abstime(), tm2interval(), and ValidateDate().
#define POSTGRES_EPOCH_JDATE 2451545 |
Definition at line 171 of file timestamp.h.
Referenced by CheckDateTokenTables(), date2timestamptz(), date_out(), date_recv(), GetCurrentIntegerTimestamp(), GetCurrentTimestamp(), localGetCurrentTimestamp(), map_sql_value_to_xml_value(), pg_tz_acceptable(), time_t_to_timestamptz(), timestamp2tm(), and timestamptz_to_time_t().
#define SECS_PER_DAY 86400 |
Definition at line 98 of file timestamp.h.
Referenced by AdjustFractDays(), convert_timevalue_to_scalar(), date2timestamp(), date2timestamp_no_overflow(), date2timestamptz(), datetimetz_timestamptz(), DecodeDateTime(), DecodeInterval(), DecodeISO8601Interval(), DetermineTimeZoneOffset(), interval2tm(), interval_cmp_value(), interval_div(), interval_justify_hours(), interval_justify_interval(), interval_mul(), interval_part(), interval_reltime(), interval_time(), pg_tz_acceptable(), PGTYPESdate_from_timestamp(), reltime2tm(), time_mi_interval(), time_pl_interval(), time_recv(), timestamp2tm(), timestamp_part(), timestamptz_part(), timestamptz_to_time_t(), timetz_izone(), timetz_recv(), timetz_zone(), and tm2timestamp().
#define SECS_PER_HOUR 3600 |
Definition at line 99 of file timestamp.h.
Referenced by abstime2tm(), AdjustIntervalForTypmod(), check_timezone(), DCH_to_char(), DecodeInterval(), DecodeISO8601Interval(), interval2tm(), interval_cmp_value(), reltime2tm(), time2tm(), timestamp2tm(), timestamptz_part(), timetz2tm(), and timetz_part().
#define SECS_PER_MINUTE 60 |
Definition at line 100 of file timestamp.h.
Referenced by AdjustIntervalForTypmod(), DCH_to_char(), DecodeInterval(), DecodeISO8601Interval(), DecodeTime(), DecodeTimeOnly(), DecodeTimezone(), DetermineTimeZoneOffset(), interval2tm(), reltime2tm(), reltimein(), ServerLoop(), time2t(), time2tm(), timestamp_time(), timestamptz_time(), timetz2tm(), timetz_part(), tm2abstime(), tm2interval(), tm2time(), and tm2timetz().
#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) |
Definition at line 137 of file timestamp.h.
Referenced by EncodeSpecialTimestamp(), timestamp_abstime(), timestamp_date(), timestamptz_abstime(), and timestamptz_date().
#define TIMESTAMP_IS_NOEND | ( | j | ) | ((j) == DT_NOEND) |
Definition at line 142 of file timestamp.h.
Referenced by EncodeSpecialTimestamp(), timestamp_abstime(), timestamp_date(), timestamptz_abstime(), and timestamptz_date().
#define TIMESTAMP_NOBEGIN | ( | j | ) | do {(j) = DT_NOBEGIN;} while (0) |
Definition at line 134 of file timestamp.h.
Referenced by abstime_timestamp(), abstime_timestamptz(), date2timestamp(), date2timestamptz(), datetimetz_timestamptz(), PGTYPEStimestamp_from_asc(), timestamp_in(), and timestamptz_in().
#define TIMESTAMP_NOEND | ( | j | ) | do {(j) = DT_NOEND;} while (0) |
Definition at line 139 of file timestamp.h.
Referenced by abstime_timestamp(), abstime_timestamptz(), date2timestamp(), date2timestamptz(), datetimetz_timestamptz(), PGTYPEStimestamp_from_asc(), timestamp_in(), and timestamptz_in().
#define TIMESTAMP_NOT_FINITE | ( | j | ) | (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j)) |
Definition at line 144 of file timestamp.h.
Referenced by AdjustTimestampForTypmod(), datetime_timestamp(), gbt_ts_dist(), map_sql_value_to_xml_value(), PGTYPESdate_from_timestamp(), PGTYPEStimestamp_add_interval(), PGTYPEStimestamp_sub(), PGTYPEStimestamp_to_asc(), timestamp2timestamptz(), timestamp_finite(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz_izone(), timestamptz_out(), timestamptz_part(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timestamp(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_to_str(), timestamptz_trunc(), timestamptz_zone(), ts_dist(), and tstz_dist().
#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 |
Definition at line 170 of file timestamp.h.
Referenced by CheckDateTokenTables(), GetCurrentIntegerTimestamp(), GetCurrentTimestamp(), localGetCurrentTimestamp(), time_t_to_timestamptz(), timestamp2tm(), and timestamptz_to_time_t().
#define USECS_PER_DAY INT64CONST(86400000000) |
Definition at line 103 of file timestamp.h.
Referenced by convert_timevalue_to_scalar(), date2timestamp_no_overflow(), date2timestamptz(), datetimetz_timestamptz(), DecodeDateTime(), interval_justify_hours(), interval_justify_interval(), interval_time(), RegisterBackgroundWorker(), time_mi_interval(), time_pl_interval(), time_recv(), timestamp2tm(), timetz_izone(), timetz_mi_interval(), timetz_pl_interval(), timetz_recv(), timetz_zone(), and tm2timestamp().
#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) |
Definition at line 106 of file timestamp.h.
Referenced by DecodeTime(), DecodeTimeOnly(), interval_div(), interval_mul(), interval_reltime(), localTimestampDifference(), time2t(), timestamp2tm(), timestamp_time(), TimestampDifference(), timestamptz_time(), timestamptz_to_str(), timestamptz_to_time_t(), timetz_izone(), timetz_zone(), tm2time(), tm2timetz(), tsrange_subdiff(), and tstzrange_subdiff().
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.