3 ms·
Yep, it's the latter. Leap seconds actually affect time_t values, whereas daylight savings does not. I think it's simpler to think of time_t (or "unix time")
by haberman 14y ago
Yep, it's the latter. Leap seconds actually affect time_t values, whereas daylight savings does not.
I think it's simpler to think of time_t (or "unix time") as independent of any time zone. It's the number of seconds since an arbitrary "epoch" that happened simultaneously everywhere in the world. It so happens that the epoch happened at midnight GMT.
Of course it's not literally the number of seconds since the epoch because of leap seconds.
- ricardobeat 14y agoIt is literally the number of seconds because of leap seconds :)
- haberman 14y agoHuh? When a leap second is added, a day has 86401 seconds, but time_t says it has only 86400. So the true number of seconds since the epoch drifts from time_t every time a leap second is added.
- deleted 14y ago[deleted]