[tz] leap second theory

Guy Harris guy at alum.mit.edu
Sun Aug 18 08:10:33 UTC 2019

BTW, Windows has recently added support for handling, rather than hiding, leap seconds:


An application must opt into time-with-leap-seconds with a SetProcessInformation() call.

That article claims that

	1) routines returning FILETIME values (somewhat equivalent to time_t/struct timeval/etc.) are not affected by that setting;

	2) routines returning SYSTEMTIME (somewhat equivalent to struct tm) are affected, and can return 60 as the number of seconds.

I don't know what Windows did with FILETIME values before the recent change; did they count 100 nanosecond intervals, with the FILETIME value incrementing by 1 every 100 nanoseconds *regardless* of whether a leap second was occurring or not, or did they do POSIX-style "pause the clock" or "slow down the clock" or... stuff to arrange that, from YYYY-DD-MM 23:59:59 to YYYY-DD-MM 23:59:60, the FILETIME value doesn't increment (or resets after 100,000,000 nanoseconds so that the leap second isn't counted)?

I'm *guessing* that, after the change, the FILETIME value increases by 1 every 100 nanoseconds, regardless of whether a leap second is occurring or not.

More information about the tz mailing list