summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas G. Lockhart1999-04-15 02:24:23 +0000
committerThomas G. Lockhart1999-04-15 02:24:23 +0000
commit99e57ee86f3493655d8314d9381646f65e2196be (patch)
tree929df01441bf75fcbfc68472491834140e55641e
parent879d1be2fe2c73ce674500bb44af2dad967086ae (diff)
Move some useful date/time test macros to here to allow
sharing across files.
-rw-r--r--src/include/utils/dt.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/include/utils/dt.h b/src/include/utils/dt.h
index 024acb4c63..9bd391b550 100644
--- a/src/include/utils/dt.h
+++ b/src/include/utils/dt.h
@@ -8,7 +8,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dt.h,v 1.38 1999/03/14 16:03:16 momjian Exp $
+ * $Id: dt.h,v 1.39 1999/04/15 02:24:23 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -285,6 +285,20 @@ extern int day_tab[2][13];
|| ((y == JULIAN_MINYEAR) && ((m > JULIAN_MINMONTH) \
|| ((m == JULIAN_MINMONTH) && (d >= JULIAN_MINDAY)))))
+#define UTIME_MINYEAR (1901)
+#define UTIME_MINMONTH (12)
+#define UTIME_MINDAY (14)
+#define UTIME_MAXYEAR (2038)
+#define UTIME_MAXMONTH (01)
+#define UTIME_MAXDAY (18)
+
+#define IS_VALID_UTIME(y,m,d) (((y > UTIME_MINYEAR) \
+ || ((y == UTIME_MINYEAR) && ((m > UTIME_MINMONTH) \
+ || ((m == UTIME_MINMONTH) && (d >= UTIME_MINDAY))))) \
+ && ((y < UTIME_MAXYEAR) \
+ || ((y == UTIME_MAXYEAR) && ((m < UTIME_MAXMONTH) \
+ || ((m == UTIME_MAXMONTH) && (d <= UTIME_MAXDAY))))))
+
/*
* dt.c prototypes
*/