This patch fixes some problems in date handling for atypical dates.
authorThomas G. Lockhart <lockhart@fourpalms.org>
Sat, 13 Feb 1999 05:59:34 +0000 (05:59 +0000)
committerThomas G. Lockhart <lockhart@fourpalms.org>
Sat, 13 Feb 1999 05:59:34 +0000 (05:59 +0000)
commit2a6faa5368f927e0cc22334ad35393351fec8ede
tree82df22d8eb4fcc1353d3a597ffc33f4425787c80
parenta0071f1393273d1c706b6a64b573b6d6d8243460
This patch fixes some problems in date handling for atypical dates.
Here is a summary:
Be more careful to check input string lengths as well as values
 when deciding whether a field is a year field.  Assume *anything* longer
 than 2 digits (if it isn't a special-case doy) is a valid year.
 This should fix the "Y1K" and "Y10K" problems
  pointed out by Massimo recently.
Check usage of BC to require a positive-valued year; before just used it
 to flip the sign of the year without checking. This led to problems
 near year zero.
Allow a 5 digit "concatenated date" of 2 digit year plus day of year.
Do 2->4 digit year correction for 6 and 5 digit "concatenated dates".
 Somehow forgot this originally. Guess not many folks use it...
Move common macros to dt.h.
src/backend/utils/adt/datetime.c
src/backend/utils/adt/dt.c