git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 633f2fb)
Add additional C comments for to_date/to_char() fixes.
Wed, 8 Aug 2012 17:26:39 +0000 (13:26 -0400)
Wed, 8 Aug 2012 17:27:01 +0000 (13:27 -0400)

diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index ddb89c463bceb282c945eb19790bd3d902009515..25af8a212b825b9446bfbf16093ac6b6d8c281bf 100644 (file)
--- 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;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /