[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: os.date seconds: 0-61?
- From: Choonster TheMage <choonster.2010@...>
- Date: Mon, 13 May 2013 23:54:23 +1000
On 13 May 2013 23:22, Brad Jorsch <firstname.lastname@example.org> wrote:
> Someone recently made a correction to our copy of the Lua manual for
> Scribunto, changing the range of values for 'sec' from 0-61 to
> 0-59. Which is incorrect, considering that leap seconds do exist, but
> that only gives a range of 0-60. How would os.date return a value of
> 61 for the seconds? Or is that an error in the Lua manual?
> : https://www.mediawiki.org/w/index.php?title=Extension:Scribunto/Lua_reference_manual&diff=688113&oldid=685956
os.date gets its values from a `tm` struct filled by either gmtime or
localtime as appropriate. According to , the tm_secs member is in
the range 0-61, but  says it's in the range 0-60.
It was hard to find a copy of the C89 standard, but the copy at 
(section 4.12.1) says it's 0-60; as does the C99(?) standard at 
So it looks like the range should be 0-60.