Commit 1201aef
fix: zero-pad year in ISO 8601 datetime formatting
`_format_datetime_iso8601` used `strftime("%Y")` which produces
fewer than 4 digits for years before 1000 on Linux/glibc. The
resulting string (e.g., "1-01-01 00:00:00+00:00") cannot be parsed
back by `fromisoformat()`, breaking roundtrip for pre-epoch dates.
Use `f"{value.year:04d}"` for the year field to ensure 4-digit
years per ISO 8601.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d48a734 commit 1201aef
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
382 | 398 | | |
383 | 399 | | |
384 | 400 | | |
| |||
0 commit comments