Skip to content

Commit

Permalink
Editorial: Fix number types in GetISOPartsFromEpoch
Browse files Browse the repository at this point in the history
Also add structured header, while we're at it.
  • Loading branch information
ptomato committed Mar 22, 2022
1 parent 369124a commit bd5b733
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions spec/timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,22 +424,26 @@ <h1>CreateTemporalTimeZone ( _identifier_ [ , _newTarget_ ] )</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-getisopartsfromepoch" aoid="GetISOPartsFromEpoch">
<h1>GetISOPartsFromEpoch ( _epochNanoseconds_ )</h1>
<p>
The abstract operation GetISOPartsFromEpoch returns the components of a date corresponding to the given number of nanoseconds since the Unix epoch in UTC.
</p>
<emu-clause id="sec-temporal-getisopartsfromepoch" type="abstract operation">
<h1>
GetISOPartsFromEpoch (
_epochNanoseconds_: an integer,
)
</h1>
<dl class="header">
<dt>description</dt>
<dd>It returns the components of a date corresponding to the given number of nanoseconds since the Unix epoch in UTC.</dd>
</dl>
<emu-alg>
1. Assert: _epochNanoseconds_ is an integer.
1. Let _remainderNs_ be _epochNanoseconds_ modulo 10<sup>6</sup>.
1. Let _epochMilliseconds_ be (_epochNanoseconds__remainderNs_) / 10<sup>6</sup>.
1. Let _year_ be ! YearFromTime(_epochMilliseconds_).
1. Let _month_ be ! MonthFromTime(_epochMilliseconds_) + 1.
1. Let _day_ be ! DateFromTime(_epochMilliseconds_).
1. Let _hour_ be ! HourFromTime(_epochMilliseconds_).
1. Let _minute_ be ! MinFromTime(_epochMilliseconds_).
1. Let _second_ be ! SecFromTime(_epochMilliseconds_).
1. Let _millisecond_ be ! msFromTime(_epochMilliseconds_).
1. Let _epochMilliseconds_ be 𝔽((_epochNanoseconds__remainderNs_) / 10<sup>6</sup>).
1. Let _year_ be ℝ(! YearFromTime(_epochMilliseconds_)).
1. Let _month_ be ℝ(! MonthFromTime(_epochMilliseconds_)) + 1.
1. Let _day_ be ℝ(! DateFromTime(_epochMilliseconds_)).
1. Let _hour_ be ℝ(! HourFromTime(_epochMilliseconds_)).
1. Let _minute_ be ℝ(! MinFromTime(_epochMilliseconds_)).
1. Let _second_ be ℝ(! SecFromTime(_epochMilliseconds_)).
1. Let _millisecond_ be ℝ(! msFromTime(_epochMilliseconds_)).
1. Let _microsecond_ be floor(_remainderNs_ / 1000) modulo 1000.
1. Let _nanosecond_ be _remainderNs_ modulo 1000.
1. Return the Record {
Expand Down

0 comments on commit bd5b733

Please sign in to comment.