Accounting for leap seconds for "this time value"

Karl Cheng qantas94heavy at gmail.com
Thu Sep 3 09:40:59 UTC 2015


The current specification has this to say about the time value in dates:

"Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC.
> In time values leap seconds are ignored. It is assumed that there are
> exactly 86,400,000 milliseconds per day."


What I would like to seek clarification about is if we were to do the
following:

```js
Math.floor(Date.now() / 1000) % 60;
```

Would complying with the specification mean that this value calculated for
the "seconds" should not correspond with the time shown outside of
JavaScript (because of leap seconds)?  For example, if that code returns
"30", would that mean that a clock following UTC should show a seconds
value of "04"? At the moment, it seems that the implementations I have
tested do not follow this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150903/e8a59b95/attachment.html>


More information about the es-discuss mailing list