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

43 questions
45
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
  • 3,502
  • 3
  • 30
  • 34
21
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
  • 16,651
  • 3
  • 38
  • 58
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?
smoofra
  • 2,715
  • 2
  • 19
  • 23
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,160
  • 3
  • 20
  • 29
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
  • 12,075
  • 6
  • 35
  • 60
11
votes
1 answer

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
  • 91,837
  • 114
  • 489
  • 768
11
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
  • 4,703
  • 5
  • 28
  • 58
8
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
  • 2,968
  • 1
  • 15
  • 35
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
  • 288
  • 1
  • 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
  • 625
  • 2
  • 8
  • 21
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
  • 178,314
  • 47
  • 389
  • 754
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
  • 11,097
  • 10
  • 70
  • 131
4
votes
2 answers

How to prove June 30th 2015 has 86401 seconds in Java 8 (new Date Time API)?

I try to prove June 30th 2015 has 86401 seconds, use Java code like this: Instant i1 = Instant.ofEpochSecond(longestDay.toEpochSecond(ZoneOffset.UTC)); Instant i2 = Instant.ofEpochSecond(oneDayAfter.toEpochSecond(ZoneOffset.UTC)); long d =…
Do Nhu Vy
  • 33,131
  • 37
  • 143
  • 202
3
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
  • 672
  • 10
  • 26
3
votes
2 answers

Leap seconds and std::chrono

I took a look att cppreference.org (emphasis mine): The clock std::chrono::utc_clock is a Clock that represents Coordinated Universal Time (UTC). It measures time since 00:00:00 UTC, Thursday, 1 January 1970, including leap seconds. Comparing that…
user877329
  • 5,419
  • 7
  • 34
  • 73
1
2 3