- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit2a6faa5

Thomas G. Lockhart
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.1 parenta0071f1 commit2a6faa5
2 files changed
+176
-58
lines changedLines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
| 30 | + | |
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
| |||
99 | 100 |
| |
100 | 101 |
| |
101 | 102 |
| |
| 103 | + | |
102 | 104 |
| |
103 | 105 |
| |
104 | 106 |
| |
105 | 107 |
| |
| 108 | + | |
106 | 109 |
| |
107 | 110 |
| |
108 | 111 |
| |
|
0 commit comments
Comments
(0)