[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.clock conversion to milliseconds under MacOS X
- From: Isaac Dupree <ml@...>
- Date: Wed, 17 Dec 2014 14:52:13 -0500
On 12/17/2014 12:05 PM, Gary V. Vaughan wrote:
> os.difftime (t2, t1)
>
> Returns the number of seconds from time t1 to time t2 (see the os.time
> function for a description of these values). In POSIX, Windows, and some
> other systems, this value is exactly t2-t1.
That documentation cannot be correct on Unix-time systems if there is a
leap second between t1 and t2.
(For example, in UTC Unix time, 1341144000 - 1341057600 = 86400 but
there were actually 86401 seconds from June 30, 2012 12:00:00 UTC to
July 1, 2012 12:00:00 UTC. That said, even Python's documentation
doesn't clearly tell me whether its time deltas treat leap seconds as
being zero seconds long; we seem to be resigned to IERS-initiated
software bugs every few years.)