You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Editorial: Inline TimeDurationSeconds and TimeDurationSubseconds
We originally planned to convert time durations to a record with a seconds
and subseconds field, but that was never necessary. Now that they are just
a mathematical value, we don't need to access them through these seconds
and subseconds operations.
See: #2953
1. If DefaultTemporalLargestUnit(_duration_) is ~second~, ~millisecond~, ~microsecond~, or ~nanosecond~, set _zeroMinutesAndHigher_ to *true*.
1966
1936
1. Let _secondsDuration_ be TimeDurationFromComponents(0, 0, _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]).
1967
1937
1. If _secondsDuration_ ≠ 0, or _zeroMinutesAndHigher_ is *true*, or _precision_ is not ~auto~, then
1968
-
1. Let _secondsPart_ be abs(TimeDurationSeconds(_secondsDuration_)) formatted as a decimal number.
1969
-
1. Let _subSecondsPart_ be FormatFractionalSeconds(abs(TimeDurationSubseconds(_secondsDuration_)), _precision_).
1938
+
1. Let _secondsPart_ be abs(truncate(_secondsDuration_ / 10<sup>9</sup>)) formatted as a decimal number.
1939
+
1. Let _subSecondsPart_ be FormatFractionalSeconds(abs(remainder(_secondsDuration_, 10<sup>9</sup>)), _precision_).
1970
1940
1. Set _timePart_ to the string concatenation of _timePart_, _secondsPart_, _subSecondsPart_, and the code unit 0x0053 (LATIN CAPITAL LETTER S).
1971
1941
1. Let _signPart_ be the code unit 0x002D (HYPHEN-MINUS) if _sign_< 0, and otherwise the empty String.
1972
1942
1. Let _result_ be the string concatenation of _signPart_, the code unit 0x0050 (LATIN CAPITAL LETTER P) and _datePart_.
1. NOTE: If using floating points to implement this operation, add the time components separately before balancing to avoid errors with unsafe integers.
0 commit comments