Also, this is one of those cases where a simple but exact solution just doesn't exist. You get to pick any two good things out of three and have to put up with either
- a) days of variable length (in seconds);
- b) seconds that themselves vary in length; or
- c) a date system that ends up getting out of synch with the Sun.
POSIX rejects (a) for simplicity of calculations, but otherwise matches UTC to match civil time, hence rejecting (c) and choosing to accept downside (b). Simplicity of calculations is explicitly mentioned in the rationale:
The topic of whether seconds since the Epoch should account for leap seconds has been debated on a number of occasions, and each time consensus was reached (with acknowledged dissent each time) that the majority of users are best served by treating all days identically. (That is, the majority of applications were judged to assume a single length-as measured in seconds since the Epoch-for all days. Thus, leap seconds are not applied to seconds since the Epoch.)
(The sentence "The relationship between the actual time of day and the current value for seconds since the Epoch is unspecified." is weird in itself, given UTC is "the actual time of day" for pretty much all practical purposes, and the definition above relies on UTC. I'm not sure what that refers to, but I think it might just meanmeans to say that the system clock is not required to be accurate. And well, without external synchronization, most computer clocks aren't.
Similarly, "Broken-down POSIX time is therefore not necessarily UTC, despite its appearance." in the rationale part looks odd, but would apply at the moment of a leap second. Otherwise the given equivalence seems to be okmean broken-down POSIX time is UTC.)