Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 171c377

Browse files
committed
C comment: mention why the Gregorian calendar is used pre-1582
1 parent 525a489 commit 171c377

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/include/utils/datetime.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ extern const char *const months[]; /* months (3-char abbreviations) */
271271
extern const char *const days[]; /* days (full names) */
272272
extern const int day_tab[2][13];
273273

274+
/*
275+
* These are the rules for the Gregorian calendar, which was adopted in 1582.
276+
* However, we use this calculation for all prior years as well because the
277+
* SQL standard specifies use of the Gregorian calendar.
278+
*/
274279
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
275280

276281

0 commit comments

Comments
 (0)