Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Add additional C comments for to_date/to_char() fixes.
authorBruce Momjian <bruce@momjian.us>
Wed, 8 Aug 2012 17:26:39 +0000 (13:26 -0400)
committerBruce Momjian <bruce@momjian.us>
Wed, 8 Aug 2012 17:27:01 +0000 (13:27 -0400)
src/backend/utils/adt/formatting.c

index ddb89c463bceb282c945eb19790bd3d902009515..25af8a212b825b9446bfbf16093ac6b6d8c281bf 100644 (file)
@@ -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;
    }