[tz] Adapting localtime.c

Paul Eggert eggert at cs.ucla.edu
Sun Oct 9 17:30:55 UTC 2016

John Haxby wrote:
> anyone who stores a timestamp as seconds since the epoch is in trouble because there are values that represent two distinct times, ie 23:59:59 and 23:59:60 UTC when there’s a leap second inserted.   They still do it, of course, and sooner or later the trading systems people are going to start complaining loudly that This Will Not Do

The trading systems people know about this problem, and fix it in different 
ways. For example, the Brazilian trading system inserts a leap second during a 
weekend outside of trading hours, which means that it can be one second ahead of 
the rest of the world for a few days. The Japanese system uses linear leap 
smearing instead, slowing its clocks for the two hours before the leap second, 
which means its clocks' errors gradually grow from 0 to 1 second ahead during 
those two hours.

It is a bit of a mess.

For more, see a previous thread on the topic, e.g.:


More information about the tz mailing list