This repository was archived by the owner on Apr 14, 2026. It is now read-only.
Commit 06b34d2
committed
Apply timezone to parsed
The `datetime.datetime.strptime` function will only return naive
timestamps, and those will crash in the database query later if run
during times when DST is changing. It can crash with
`NonExistantTimeError` when the clock moves forward, and with
`AmbiguousTimeError` when the clock moves back.
Since we know(?) that we always provide a "UTC" suffix to these
timestamps, I think it is safe to hardcode that we add the
`timezone.utc` as the tzinfo to these parsed objects.since timestamp1 parent d8992ae commit 06b34d2
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments