This patch fixes some problems in date handling for atypical dates.
authorThomas G. Lockhart <[email protected]>
Sat, 13 Feb 1999 05:59:34 +0000 (05:59 +0000)
committerThomas G. Lockhart <[email protected]>
Sat, 13 Feb 1999 05:59:34 +0000 (05:59 +0000)
commitfe5667f77aac3a6e152acb3b6b34f08aa1d77878
tree98e9ea9382e567009d7036b35595e30db43d3c26
parent9afd2b22aa368106c42ff2a87ce0fdd95e722646
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