*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.25.2.2 1999/02/13 05:59:34 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.25.2.3 1999/03/06 22:49:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
static int date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn);
-#if 0
-static int day_tab[2][12] = {
- {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
-{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
-
-#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
-#endif
-
#define UTIME_MINYEAR (1901)
#define UTIME_MINMONTH (12)
#define UTIME_MINDAY (14)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.59.2.2 1999/02/13 05:59:34 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.59.2.3 1999/03/06 22:49:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#define ROUND_ALL 0
#if 0
-#define isleap(y) (((y % 4) == 0) && (((y % 100) != 0) || ((y % 400) == 0)))
-
int mdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0};
#endif
* These routines will be used by other date/time packages - tgl 97/02/25
*/
-#if 0
-XXX moved to dt.h - thomas 1999-01-15
+#if 1
/* Set the minimum year to one greater than the year of the first valid day
* to avoid having to check year and day both. - tgl 97/05/08
*/
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dt.h,v 1.33.2.1 1999/03/03 05:11:39 thomas Exp $
+ * $Id: dt.h,v 1.33.2.2 1999/03/06 22:49:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern int day_tab[2][13];
-#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
+#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
/* Julian date support for date2j() and j2date()
* Set the minimum year to one greater than the year of the first valid day