Questions tagged [leap-second]

A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC) in order to keep its time of day close to the mean solar time.

A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC) in order to keep its time of day close to the mean solar time.

See http://en.wikipedia.org/wiki/Leap_second

46 questions
59
votes
4 answers

Unix time and leap seconds

Regarding Unix (POSIX) time, Wikipedia says: Due to its handling of leap seconds, it is neither a linear representation of time nor a true representation of UTC. But the Unix date command does not seem to be aware of them actually $ date -d…
Campa
  • 4,267
  • 3
  • 37
  • 42
20
votes
2 answers

Extract historic leap seconds from tzdata

Is there a way to extract the moment of historic leap seconds from the time-zone database that is distributed on most linux distributions? I am looking for a solution in python, but anything that works on the command line would be fine too. My use…
Bas Swinckels
  • 18,095
  • 3
  • 45
  • 62
20
votes
7 answers

Does the windows FILETIME structure include leap seconds?

The FILETIME structure counts from January 1 1601 (presumably the start of that day) according to the Microsoft documentation, but does this include leap seconds?
Lawrence D'Anna
  • 2,998
  • 2
  • 22
  • 25
14
votes
2 answers

What does python return on the leap second

What does python time and datetime module return on the leap second? What will I get when we are at 23:59:60.5 if I call: time.time() datetime.datetime.utcnow() datetime.datetime.now(pytz.utc) Also, any difference between py2.7 and py3? Why it is…
Mario Corchero
  • 5,257
  • 5
  • 33
  • 59
12
votes
2 answers

What do Unix timestamps actually track?

I know that the Unix timestamp is defined as the number of seconds passed since 1970-01-01 00:00:00Z. However, I could not find a clear source that gives this definition. I've also read various different statements about the relationship between UTC…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
12
votes
2 answers

Python - Datetime not accounting for leap second properly?

I am parsing some data that has the leapsecond timestampe datetime 2012-06-30T23:59:60.209215. I used following code to parse that string and convert to a datetime object: nofrag, frag = t.split('.') nofrag_dt =…
madtowneast
  • 2,350
  • 3
  • 22
  • 31
12
votes
1 answer

Storing a leap second in SQL Server 2008

This weekend is an extra long one as there will be an extra second inserted after 23:59:59 on June 30th. We have a system that logs a lot of data around the clock and one of the business rules is that no two records can be logged as having occurred…
Widor
  • 13,003
  • 7
  • 42
  • 64
10
votes
4 answers

How to obtain current TAI time?

How can I obtain the current TAI time in milliseconds in Linux using either Java or C++? The reason I need this is to be able to accurately take timestamps over a long period of time (on the order of years) and still be able to compare them, without…
Daniel Centore
  • 3,220
  • 1
  • 18
  • 39
7
votes
1 answer

std::chrono and missing (?) support for negative leap seconds

C++20 added time zone support to std::chrono, and this includes leap seconds. However, it appears as if only leap second insertion was supported, not leap second removal, that is, negative leap seconds. (Admittedly, since 1972 there only have been…
sh-
  • 941
  • 6
  • 13
7
votes
3 answers

Duration with leap seconds

I need to schedule a task in my code at a fixed datetime. For that I'm using a ScheduledExecutorService with the method schedule(Runnable command, long delay, TimeUnit unit); How can I compute this delay according to leap seconds ? For the moment I…
Zycho
  • 298
  • 3
  • 13
6
votes
4 answers

How can I handle a leap second correctly in my application

I am creating applications and I'd like to know how I should/can handle a leap second. I'll try to describe the problem with a (hopefully) simple example situation. In this simple situation you could easily argue that an extra second of waiting time…
Dex
  • 704
  • 2
  • 9
  • 22
5
votes
2 answers

How to enable full UTC support for Leap Seconds in PHP's DateTime?

I wanted to do some DateTime calculations with Leap Seconds, but it stopped pretty early because I could not tell DateTime what I meant: ### June 30, 2012 at 23:59:60 UTC ### $leap = new…
hakre
  • 193,403
  • 52
  • 435
  • 836
4
votes
1 answer

How does Unix Epoch time behave on a leap smeared clock?

Consider a machine whose time is smeared during a leap second with a noon-to-noon linear smear. I'm wondering how the system clock provides accurate Epoch time during the smear period. Example: The leap second is scheduled at 31st dec of 2016. On…
Nicolai Schmid
  • 1,022
  • 1
  • 14
  • 29
4
votes
2 answers

With the Win 10 Oct 2018 update, Windows is leap second aware. Is .NET's DateTime, too, now?

In 2012, there was a question here on SO, whether .NET's DateTime are capable of recognizing leap seconds. [1] The answer was no. The documentation is still explicitly stating that it is not. [2] However, Windows Server 2019 and the Windows 10…
user1889116
4
votes
4 answers

Parsing LocalTime with leap second

I am trying to understand how to build a custom DateTimeFormatter for my application. I basically need to handle time that are written like this "HHMMSS.FFFFFF". I was able to get 99% of it using: import static…
malat
  • 12,152
  • 13
  • 89
  • 158
1
2 3 4