[tz] zoneinfo vs zoneinfo-leaps

Guy Harris guy at alum.mit.edu
Mon Nov 16 22:17:14 UTC 2015

On Nov 16, 2015, at 2:07 PM, John Haxby <john.haxby at oracle.com> wrote:

> Also Posix specifically says that there are 86400 seconds in a day, every day, without exception.   It allows for the time 23:59:60

It does?

If there are 86400 seconds in every day, then every day begins at 00:00:00 and ends at 23:59:59, which is followed by 00:00:00 of the next day.  No room for 23:59:60 there.

> by saying that the time in seconds is /approximately/ the time since midnight at the start of 1970 …
> It’s a mess, but it’s a well-intentioned mess.   t + 86400 is this time tomorrow.   For those few people who are prepared to do arithmetic “properly” (tomorrow might be t + 86399 or t + 86401)

Where "properly" means "break the time_t down into year/month/day/hour/minute/second, add 1 to the day, carry into the month if that makes the day number bigger than the number of days in the month in question, carry into the year if carrying into the month makes it go from 11 to 12, and then convert that back into a time_t".

More information about the tz mailing list