diff options
Diffstat (limited to 'src/include/utils/timestamp.h')
-rw-r--r-- | src/include/utils/timestamp.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 35221d5f1df..3e2ac94a215 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.50 2005/07/21 15:16:27 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.51 2005/07/21 18:06:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -65,16 +65,22 @@ typedef struct #define MONTHS_PER_YEAR 12 /* * DAYS_PER_MONTH is very imprecise. The more accurate value is - * 365.25/12 = 30.4375, or '30 days 10:30:00'. Right now we only + * 365.2425/12 = 30.436875, or '30 days 10:29:06'. Right now we only * return an integral number of days, but someday perhaps we should * also return a 'time' value to be used as well. */ #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ #define HOURS_PER_DAY 24 /* assume no daylight savings time changes */ -#define SECS_PER_DAY 86400 /* assumes no leap second */ +/* + * This doesn't adjust for uneven daylight savings time intervals, nor + * leap seconds. + */ +#define SECS_PER_YEAR (36525 * 864) /* avoid floating-point computation */ +#define SECS_PER_DAY 86400 #define SECS_PER_HOUR 3600 #define SECS_PER_MINUTE 60 +#define MINS_PER_HOUR 60 #ifdef HAVE_INT64_TIMESTAMP #define USECS_PER_DAY INT64CONST(86400000000) |