POSIX Time: Not What You Think

2024-12-26

This article debunks a common misconception about POSIX time (Unix time): it's not simply the number of seconds since January 1, 1970, 00:00:00. Due to leap seconds, the number of seconds in a UTC day isn't a constant 86,400, leading to discrepancies between POSIX time and the actual number of seconds. The article delves into the impact of leap seconds on time calculations and recommends alternatives like CLOCK_MONOTONIC or TAI for precise timekeeping, avoiding errors caused by leap seconds.

Development POSIX time leap seconds