diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-04 04:50:44 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-04 04:50:44 +0000 |
| commit | d685417fbb8692d5ddee8ce60fc80e6b228c81bf (patch) | |
| tree | 2946cb557c8c40cc312a455355f35188a1460ad5 /src/include/utils/datetime.h | |
| parent | 3b4ca4c0d9dd5807013a8404fc8283219f21f93b (diff) | |
| download | postgresql-d685417fbb8692d5ddee8ce60fc80e6b228c81bf.tar.gz | |
Avoid repeated computation of the constants date2j(1970, 1, 1) and
date2j(2000, 1, 1). Should make for some marginal speed improvement
in date/time operations.
Diffstat (limited to 'src/include/utils/datetime.h')
| -rw-r--r-- | src/include/utils/datetime.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h index 39905ebb15..3a41961548 100644 --- a/src/include/utils/datetime.h +++ b/src/include/utils/datetime.h @@ -9,7 +9,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: datetime.h,v 1.36 2003/02/20 05:24:55 tgl Exp $ + * $Id: datetime.h,v 1.37 2003/04/04 04:50:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -259,6 +259,10 @@ extern int day_tab[2][13]; || (((y) == UTIME_MAXYEAR) && (((m) < UTIME_MAXMONTH) \ || (((m) == UTIME_MAXMONTH) && ((d) <= UTIME_MAXDAY)))))) +/* Julian-date equivalents of Day 0 in Unix and Postgres reckoning */ +#define UNIX_EPOCH_JDATE 2440588 /* == date2j(1970, 1, 1) */ +#define POSTGRES_EPOCH_JDATE 2451545 /* == date2j(2000, 1, 1) */ + extern void GetCurrentDateTime(struct tm * tm); extern void GetCurrentTimeUsec(struct tm * tm, fsec_t *fsec, int *tzp); @@ -289,7 +293,7 @@ extern int EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str); extern int DecodeSpecial(int field, char *lowtoken, int *val); extern int DecodeUnits(int field, char *lowtoken, int *val); -extern bool ClearDateCache(bool, bool, bool); +extern bool ClearDateCache(bool newval, bool doit, bool interactive); extern int j2day(int jd); |
