Menu

A glitch in February of the year 0
📰
22

A glitch in February of the year 0

Hacker News·3 months ago
#ZlZFWZw8
Reading 0:00
15s threshold

Blog > Post A technical report about a rare correctness issue that we found and fixed. Recently, as we were adding support for timestamps in the distant past, a team member noticed during testing that some timestamps weren’t handled correctly. The issue could be easily reproduced with the timestamp 0000-02-03 04:00 Europe/Oslo . A first investigation showed that the problem affected all time zones, but only in February of the year 0 (as well as the last few days of January). Most time series don’t have timestamps that are two thousand years in the past. But, of course, we want to parse all timestamps in the supported range correctly, even the rare cases dating back to antiquity. Time for bug hunting We started looking for the bug, assuming that, surely, it would be in our own code. We use the calendar logic provided by the PHP runtime (the DateTimeImmutable class), but we still have some non-trivial processing on timestamps.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More