leap-second

How to obtain current TAI time?

江枫思渺然 提交于 2019-12-04 06:29:15
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 worrying about leap seconds. It is possible for multiple measurements to take place during a leap second and all measurements need to be unambiguous, monotonically increasing, and linearly increasing. This will be a dedicated Linux server. This is for a scientific project which needs precision of about .5 seconds. I do not currently wish to invest

Storing a leap second in SQL Server 2008

和自甴很熟 提交于 2019-12-03 11:21:14
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 at the same time, to within one second. We're using UTC datetimes along with the new datetimeoffset data type, but as far as I can tell they won't let you have more than 60 seconds in a minute. Certainly, this throws an error: select datediff(ss, getdate(), '30-jun-2012 23:59:60') But according to the UTC gods this will be a real time. Events can

Extract historic leap seconds from tzdata

无人久伴 提交于 2019-11-29 01:16:50
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 case is to convert between gps-time (which is basically the number of seconds since the first GPS-satellite was switched on in 1980) and UTC or local time. UTC is adjusted for leap-seconds every now and then, while gps-time increases linearly. This is equivalent to converting between UTC and TAI . TAI also ignores leap-seconds, so TAI and gps-time

Does the windows FILETIME structure include leap seconds?

雨燕双飞 提交于 2019-11-28 11:56:01
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? Ian Boyd The question shouldn't be if FILETIME includes leap seconds. It should be: Do the people, functions, and libraries, who interpret a FILETIME (i.e. FileTimeToSystemTime ) include leap seconds when counting the duration? The simple answer is "no" . FileTimeToSystemTime returns seconds as 0..59 . The simpler answer is: " of course not, how could it? ". My Windows 2000 machine doesn't know that there were 2 leap seconds added in

Python - Datetime not accounting for leap second properly?

瘦欲@ 提交于 2019-11-27 23:43:12
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 = datetime.datetime.strptime(nofrag, "%Y-%m-%dT%H:%M:%S") dt = nofrag_dt.replace(microsecond=int(frag)) Python documentation claims that this shouldn't be an issue as %S accepts [0, 61] . But, I get this error with the above timestamp nofrag_dt = datetime.datetime.strptime(nofrag, "%Y-%m-%dT%H:%M:%S") ValueError: second must be in 0..59 Thanks Do this: import time import datetime t =

Does the windows FILETIME structure include leap seconds?

删除回忆录丶 提交于 2019-11-27 06:36:48
问题 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? 回答1: The question shouldn't be if FILETIME includes leap seconds. It should be: Do the people, functions, and libraries, who interpret a FILETIME (i.e. FileTimeToSystemTime ) include leap seconds when counting the duration? The simple answer is "no" . FileTimeToSystemTime returns seconds as 0..59 . The simpler answer is: " of course

Unix time and leap seconds

非 Y 不嫁゛ 提交于 2019-11-26 22:44:05
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 '@867715199' --utc Mon Jun 30 23:59:59 UTC 1997 $ date -d '@867715200' --utc Tue Jul 1 00:00:00 UTC 1997 While there should be a leap second there at Mon Jun 30 23:59:60 UTC 1997 . Does this mean that only the date command ignores leap seconds, while the concept of Unix time doesn't? Thomas Jung The number of seconds per day are fixed with Unix timestamps .

Unix time and leap seconds

回眸只為那壹抹淺笑 提交于 2019-11-26 09:02:19
问题 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 \'@867715199\' --utc Mon Jun 30 23:59:59 UTC 1997 $ date -d \'@867715200\' --utc Tue Jul 1 00:00:00 UTC 1997 While there should be a leap second there at Mon Jun 30 23:59:60 UTC 1997 . Does this mean that only the date command ignores leap seconds, while