Leap Seconds in Windows

Solution 1:

How the Windows Time service treats a leap second

The Windows Time service does not indicate the value of the Leap Indicator when the Windows Time service receives a packet that includes a leap second. (The Leap Indicator indicates whether an impending leap second is to be inserted or deleted in the last minute of the current day.) Therefore, after the leap second occurs, the NTP client that is running Windows Time service is one second faster than the actual time. This time difference is resolved at the next time synchronization.

Solution 2:

Windows is normally acting as an NTP client. It will just get its time up to date during the next update from the NTP server, which clearly has methods of handling leap seconds. This will happen, provided your system is setup to synchronize time via NTP. If it is not, then nothing will happen as Windows 7 does not have built-in functionality to deal with leap seconds

Solution 3:

They are not implemented.

Just like a wristwatch, PC time-keeping is dumb. As others have mentioned, Windows 7 uses NTP to sync PC time to a known source. Which is the equivalent of you adjusting your wristwatch every now and then.

However, the leap-second does become a problem if you intend to write code that involves date/time math, where the number of seconds between two dates is important, AND where those calculations must match up with some kind of external system or data that is leap-second aware. I'm struggling to think of any such scenarios, but I imagine there are some out there.

Solution 4:

Windows just keeps ticking along. There is no provision for leap seconds in Windows time service. It's also important to note that no major operating system has a provision for leap seconds.

At first glance, this may sound strange. If you understand what a leap second is for and when they are added, it becomes very simple.

The International Earth Rotation and Reference Systems Service monitors the earth's rotation for irregularities. Some factors alter the earth's rotation. These include tidal friction and the melting of continental ice sheets (weight changes!). In aggregate, the earth is slowing ever so slightly.

From Wikipedia:

Leap seconds are irregularly spaced because the Earth's rotation speed changes irregularly. Indeed, the Earth's rotation is quite unpredictable in the long term, which explains why leap seconds are announced only six months in advance.

Since it is irregular and announced as needed, all modern operating systems rely on Network Time Protocol (NTP) to recover from the leap second. This is such a widespread and known issue with no graceful solution that asian markets delayed their opening by five minutes to give the computers enough time to check NTP for a time update during the last leap second.