Microsoft is bringing support for leap seconds – yes, that one extra second – to Windows, starting with Windows 10 Redstone 5 and Windows Server 2019. With the upcoming updates for Windows 10, Microsoft’s operating system now deals with leap seconds in a way that is incredibly accurate, UTC-compliant, and traceable.
Leap seconds typically occur every 18 months, resulting in one extra second. The extra leap second occurs to adjust with the earth’s slowed down rotation, and an extra second is added to UTC in order to keep it in-sync with mean solar time. To deal with the extra second more appropriately, Windows 10 will now display that extra second, instead of directly jumping to the next one, making it the world’s first OS to have full support for leap seconds.
I didn’t know operating systems didn’t fully support leap seconds. That is a big surprise to me.
For most consumers, NTP handles it just fine for you.
Google does it differently, they “easy-in” the leap second by distributing the 1000 milliseconds over the day to avoid issues with some software when a sudden jump comes.
This obviously isn’t something meant to benefit most consumers.
Since your clock is synced to NTP only periodically, that means when the leap second occurs, your clock is wrong for several hours after the leap second occurs between syncs.
For some use cases, this isn’t allowed.
They way Google does it is also wrong – it means your clock is wrong all day.
In addition to handling leap seconds, Microsoft is also integrating support for PTP, which is a much higher precision time protocol.
Whereas NTP can synchronize to less than a millisecond on a local network, PTP is capable of sub-microsecond precision.
Because the Earth’s rotation speed varies in response to climatic and geological events, UTC leap seconds are irregularly spaced and unpredictable. Insertion of each UTC leap second is usually decided about six months in advance by the International Earth Rotation and Reference Systems Service (IERS), when needed to ensure that the difference between the UTC and UT1 readings will never exceed 0.9 seconds.
So there’s really no way to automatically determine leap seconds without having someone signal them over the net… which I imagine MS is now doing for W10. Network time protocol already handles leap seconds, and you can bet most linux/OSX people are using that, and the ones that aren’t could care less about leap seconds.
Hi,
There’s a lot more to handling leap seconds than just knowing when the next one will occur. For a simple example, consider (accurately) calculating how much time passed between file system time stamps when one file is a few years older than another.
Of course usually it causes a whole pile of bugs to surface (due to people assuming there’s always 60 seconds per minute) where times will get stored wrong or displayed wrong during the extra 61st second.
– Brendan
While that’s true, there has been 27 leap seconds added since they started. I’m not aware of any financial terms that work on seconds… or minutes… maybe hours for loan sharks. I don’t have a single account that’s updated less than monthly. So the worst that happens is what? Your account is updated 1 second later than you expected?
Brendan,
I can not agree with the semantics of that, haha. All minutes are 60 seconds by definition. Leap seconds used to resync time to the earth’s movement are just that, it doesn’t change our units of measurement. If it did it would result in chaos, we’d have people breaking records in those long minutes. Other units like RPM would likewise be messed up by those 61second minutes. I say nay, all minutes are 60 seconds and it is not a bug. Rather we have to accept the reality that every time we resync our time to earth reference, it represents a discontinuity between time frames.
The reason we have this mess in the first place is because society has shoehorned the same time units into two incompatible applications: representing earth’s motions through space, versus representing constant scientific units. Earth days are certainly useful for managing our calendars, but it’s highly unfortunate that we’ve conflated different types of time measurement. Just think, this whole problem would go away if we stopped conflating units of time. Computers could just track calendar days (and fractions of days) to represent date/time stamps. NTP could fix any tiny discrepancy between earth’s movement on a daily basis and all computer time would be in perfect harmony because there’s no false assumption that a day precisely equals a constant time.
Hi,
No (or maybe yes, depending on whether you make up a non-standard definition).
For “theoretically possible” definitions; there are two main categories – a second is always exactly the same length (and therefore the number of seconds per day must vary extremely slightly), or the length of a second varies (and therefore the number of seconds per day remains the same and you don’t have any leap seconds at all). The first definition is used by everything, partly because there’s a set of equations that link all units (time, distance, speed, acceleration, charge, pressure, power, torque, …) into a single system, where if seconds varied the entire system of equations would be broken.
For the official UTC standard; when a leap second occurs the last minute of that day is 1 second longer (or 1 second shorter, but that never happens). For a 24-hour clock; it’s literally meant to go “23:59:59, 23:59:60, 0:00:00”.
Unfortunately; “Unix standard time” is a different standard – it doesn’t follow UTC (and is amazingly idiotic). In this case, when they jam the 61st second into the last minute of the day the same time/s happen twice (e.g. “23:59:59.0” happens once at the start of the 60th second and then happens again at the start of the 61st second), and you get time going backwards briefly (e.g. from “23:59:59.123” to “23:59:59.0 again”) which is nasty for anything not expecting “now – then” to be negative.
– Brendan
Brendan,
I disagree, it’s the leap seconds that are nasty, unix time stamps are quite nice if we don’t try to do nonsensical things like jamming 61 seconds into a minute. This goes back to conflating units; if we stop pretending that earth movement based time units = scientific time units, then the problems go away.
Leap seconds are problematic for a whole host of applications that can’t handle extra seconds. I’m not the only one who thinks so, many of us in computer science would like to abolish them:
https://en.wikipedia.org/wiki/Leap_second#Proposal_to_abolish_leap_s…
The simplicity of unixtime is a beautiful thing, it only broke once we started adding discontinuities in clock time, which also breaks practically every clock in the world(albeit by one second every now and then).
IMHO the simplest solution is best: accept the physical reality that clock time based on earth’s rotation is “off” ever so slightly and simply use NTP to continually update the clock normally without leap seconds at all. We should never suddenly add/subtract whole seconds in an unexpected way as leap seconds do, that is a terrible practice we should abolish. The benefit of this “do less” approach is clear: all computers/software can trivially keep their clocks in sync with no discontinuities or exceptions. Since the “earth drift” is well within the margins of error for CMOS clocks anyways, the change would be imperceptible to just about all applications that need a time stamp.
http://www.ntp.org/ntpfaq/NTP-s-trbl-spec.htm#AEN5674
First notepad, now adding leap second support? WOW! Microsoft is really on a roll here. I expect full market domination in just a few years if they keep up this unprecedented level of technological advancement.
Rant about computers and timezones:
https://www.youtube.com/watch?v=-5wpm-gesOY
Leap second mentioned at 6:47
He should’ve waited until 6:60 to start talking about leap seconds.
MS has a broken Leap Year issue going back to the MS-DOS days that they still haven’t fixed.
Why add support for Leap Seconds which can be handled by the Network Time Protocol?
um… maybe because it is supported by NTP?
NTP isn’t meant to be used as a clock, or for measuring time. If you wanted to set a specific event to happen at 17:24.25, you wouldn’t use NTP to tell you when it was a quarter second after 17:24.
It’s meant to be used for time synchronization of devices that have their own clocks. You would use NTP to tell you that, at this specific moment, it is 09:33.382, and use your own clocks to tell you when it is 17:24.25
Furthermore, imagine you have very basic time support in your OS. “Why add support for Leap Years which can be handled by the Network Time Protocol?” you might ask.
What do you do if your basic clock doesn’t handle February 29, but NTP tells you that it is indeed that date?
Well, this is sort of the same thing.