1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Update DAYS_PER_MONTH comment.

Add SECS_PER_YEAR and MINS_PER_HOUR macros.
This commit is contained in:
Bruce Momjian
2005-07-21 18:06:13 +00:00
parent a0407f508a
commit e6b72d6af6
11 changed files with 82 additions and 71 deletions

View File

@@ -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)