Tracking PG&E outages by scraping to a Git repo
simonwillison.net
simonwillison.net
¹iiiish. Let's forget leap seconds exist.
A Unix timestamp doesn't specify a time, it specifies an offset from another time. It makes sense logically, the calculation is `current_time - epoch_time`, and the result of subtracting two times is a duration.
They are however, easily converted into a time: `epoch_time + unix_timestamp`, and logically a time plus a duration produces a time.
If a timestamp is a time, that logic all breaks. Like `epoch_time + today` doesn't really make any sense.
This lead to one of the hardest to track down bugs I ever encountered (ultimately came down to LocalTime(0, "London") coming out as 01:00 when 00:00 was expected)