projects
/
postgresql
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
525a489
)
C comment: mention why the Gregorian calendar is used pre-1582
author
Bruce Momjian
<bruce@momjian.us>
Thu, 6 Nov 2014 07:33:05 +0000
(
02:33
-0500)
committer
Bruce Momjian
<bruce@momjian.us>
Thu, 6 Nov 2014 07:33:05 +0000
(
02:33
-0500)
src/include/utils/datetime.h
patch
|
blob
|
history
diff --git
a/src/include/utils/datetime.h
b/src/include/utils/datetime.h
index 9b53ee38ccf93b13586a18eafddfac67d5bc4f3a..548758a14930875211103386d8647ab556e6e1a3 100644
(file)
--- a/
src/include/utils/datetime.h
+++ b/
src/include/utils/datetime.h
@@
-271,6
+271,11
@@
extern const char *const months[]; /* months (3-char abbreviations) */
extern const char *const days[]; /* days (full names) */
extern const int day_tab[2][13];
+/*
+ * These are the rules for the Gregorian calendar, which was adopted in 1582.
+ * However, we use this calculation for all prior years as well because the
+ * SQL standard specifies use of the Gregorian calendar.
+ */
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))