Commit 008c40e
fix: str2time rejects epoch -1 (Dec 31, 1969 23:59:59 UTC)
The epoch -1 detection logic compares parsed date components against
a hardcoded string to distinguish the legitimate -1 return value from
timegm/timelocal errors. However, since two-digit years are now
normalized to four-digit years before the timegm call, the comparison
always fails — the join produces "59592331111969" (year=1969) but the
check expected "595923311169" (year=69).
Fix: update the UTC check to use the 4-digit year string, and adjust
the local-time check to add 1900 to the localtime(-1) year component.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent de1fb47 commit 008c40e
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
319 | 321 | | |
320 | | - | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
257 | 277 | | |
0 commit comments