Add additional C comments for to_date/to_char() fixes.

This commit is contained in:
Bruce Momjian 2012-08-08 13:26:39 -04:00
parent 633f2fbd88
commit 2751740ab5

View File

@ -3504,8 +3504,10 @@ do_to_timestamp(text *date_txt, text *fmt,
if (tmfc.bc) if (tmfc.bc)
tmfc.cc = -tmfc.cc; tmfc.cc = -tmfc.cc;
if (tmfc.cc >= 0) if (tmfc.cc >= 0)
/* +1 becuase 21st century started in 2001 */
tm->tm_year = (tmfc.cc - 1) * 100 + 1; tm->tm_year = (tmfc.cc - 1) * 100 + 1;
else else
/* +1 because year == 599 is 600 BC */
tm->tm_year = tmfc.cc * 100 + 1; tm->tm_year = tmfc.cc * 100 + 1;
} }