From: Bruce Momjian Date: Wed, 8 Aug 2012 17:26:39 +0000 (-0400) Subject: Add additional C comments for to_date/to_char() fixes. X-Git-Tag: REL9_3_BETA1~1124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2751740ab5c01b2ffc8afdb86b4c2c2bf37203e0;p=postgresql Add additional C comments for to_date/to_char() fixes. --- diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index ddb89c463b..25af8a212b 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -3504,8 +3504,10 @@ do_to_timestamp(text *date_txt, text *fmt, if (tmfc.bc) tmfc.cc = -tmfc.cc; if (tmfc.cc >= 0) + /* +1 becuase 21st century started in 2001 */ tm->tm_year = (tmfc.cc - 1) * 100 + 1; else + /* +1 because year == 599 is 600 BC */ tm->tm_year = tmfc.cc * 100 + 1; }