lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On Dec 17, 2014, at 4:17 PM, Joseph Wallace <tangent128@gmail.com> wrote:
> 
> On 12/17/2014 02:52 PM, Isaac Dupree wrote:
>> 
>> 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.)
>> 
> 
> Depends if you are using UTC Unix time (traditional) or TAI Unix time
> (the "right/" tzdata files). ;)
> 

Leap seconds or not, the real point is that “wall time” measures of time are never monatonic; after all a clock may be “wrong” and need to be corrected at any time (including from user input). If durations need to be measured by subtracting two time points, then a monotonic time measure such as time since last boot should be used (e.g. uptime).

—Tim