Skip to content

Commit

Permalink
Normative: Change offset in ISODateTimeWithinLimits to actually 24h
Browse files Browse the repository at this point in the history
The note (and the algorithm itself) claims:

> time within 24 hours (8.64 × 10^16 nanoseconds)

This is incorrect, 24 hours are 8.64 × 10^13 nanoseconds, which is the
value that was intended to be used here (it's already correctly used in
other places). 8.64 × 10^16 nanoseconds are actually 24000 hours.
  • Loading branch information
linusg authored and ptomato committed Aug 31, 2021
1 parent 50ce7a0 commit 1d61d6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/plaindatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -857,16 +857,16 @@ <h1>GetEpochFromISOParts ( _year_, _month_, _day_, _hour_, _minute_, _second_, _
<h1>ISODateTimeWithinLimits ( _year_, _month_, _day_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_ )</h1>
<emu-note>
<p>
Temporal.PlainDateTime objects can represent points in time within 24 hours (8.64 × 10<sup>16</sup> nanoseconds) of the Temporal.Instant boundaries.
Temporal.PlainDateTime objects can represent points in time within 24 hours (8.64 × 10<sup>13</sup> nanoseconds) of the Temporal.Instant boundaries.
This ensures that a Temporal.Instant object can be converted into a Temporal.PlainDateTime object using any time zone.
</p>
</emu-note>
<emu-alg>
1. Assert: _year_, _month_, _day_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, and _nanosecond_ are integers.
1. Let _ns_ be ! GetEpochFromISOParts(_year_, _month_, _day_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_).
1. If _ns_ ≤ -8.64 × 10<sup>21</sup> - 8.64 × 10<sup>16</sup>, then
1. If _ns_ ≤ -8.64 × 10<sup>21</sup> - 8.64 × 10<sup>13</sup>, then
1. Return *false*.
1. If _ns_ ≥ 8.64 × 10<sup>21</sup> + 8.64 × 10<sup>16</sup>, then
1. If _ns_ ≥ 8.64 × 10<sup>21</sup> + 8.64 × 10<sup>13</sup>, then
1. Return *false*.
1. Return *true*.
</emu-alg>
Expand Down

0 comments on commit 1d61d6f

Please sign in to comment.