Skip to content

Commit 99e57ee

Browse files
author
Thomas G. Lockhart
committed
Move some useful date/time test macros to here to allow
sharing across files.
1 parent 879d1be commit 99e57ee

File tree

1 file changed

+15
-1
lines changed
  • src/include/utils

1 file changed

+15
-1
lines changed

src/include/utils/dt.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: dt.h,v 1.38 1999/03/14 16:03:16 momjian Exp $
11+
* $Id: dt.h,v 1.39 1999/04/15 02:24:23 thomas Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -285,6 +285,20 @@ extern int day_tab[2][13];
285285
|| ((y == JULIAN_MINYEAR) && ((m > JULIAN_MINMONTH) \
286286
|| ((m == JULIAN_MINMONTH) && (d >= JULIAN_MINDAY)))))
287287

288+
#define UTIME_MINYEAR (1901)
289+
#define UTIME_MINMONTH (12)
290+
#define UTIME_MINDAY (14)
291+
#define UTIME_MAXYEAR (2038)
292+
#define UTIME_MAXMONTH (01)
293+
#define UTIME_MAXDAY (18)
294+
295+
#define IS_VALID_UTIME(y,m,d) (((y > UTIME_MINYEAR) \
296+
|| ((y == UTIME_MINYEAR) && ((m > UTIME_MINMONTH) \
297+
|| ((m == UTIME_MINMONTH) && (d >= UTIME_MINDAY))))) \
298+
&& ((y < UTIME_MAXYEAR) \
299+
|| ((y == UTIME_MAXYEAR) && ((m < UTIME_MAXMONTH) \
300+
|| ((m == UTIME_MAXMONTH) && (d <= UTIME_MAXDAY))))))
301+
288302
/*
289303
* dt.c prototypes
290304
*/

0 commit comments

Comments
 (0)