Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLocalTimeZoneAdjustment/LocalTZA follow-ups necessary #1070
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
cc @jungshik |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
apaprocki
Mar 21, 2018
Contributor
@anba I'm curious about your point about LocalTZA accepting Number and not the more restrictive time value. Why do you feel it should accept values outside of the maximum time value range?
|
@anba I'm curious about your point about |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
anba
Mar 21, 2018
Contributor
@apaprocki Because the input can be a local time value which includes the time zone offset, which means it can overflow the maximum allowed time value.
|
@apaprocki Because the input can be a local time value which includes the time zone offset, which means it can overflow the maximum allowed time value. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Apr 4, 2018
Member
@anba Do you believe the specification currently requires such calculations to be done exactly due to the use of mathematical values in all calculations?
|
@anba Do you believe the specification currently requires such calculations to be done exactly due to the use of mathematical values in all calculations? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
anba
Apr 4, 2018
Contributor
@littledan The difference between mathematical values and IEEE-754 numbers resp. it's safe-integer subset is, for once, not relevant.
I think the test case for that issue was something like this.
// Assume the local time offset is positive, let's say TZ=Europe/Berlin.
var d = new Date(8640000000000000); // d.[[DateValue]] = 8,640,000,000,000,000
d.setMilliseconds(0);20.3.4.23 Date.prototype.setMilliseconds ( ms )
1. Let t be LocalTime(? thisTimeValue(this value)).
2. Let ms be ? ToNumber(ms).
3. Let time be MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), ms).
4. Let u be TimeClip(UTC(MakeDate(Day(t), time))).
5. Set the [[DateValue]] internal slot of this Date object to u.
6. Return u.
tin step 1 is then 8640000007200000 (8640000000000000 + 2hr TZA for Europe/Berlin).msin step 2 is 0.timein step 3 is 7200000.- Step 4 then invokes
UTC(8640000007200000).
20.3.1.9 UTC ( t )
1. Return t - LocalTZA(t, false).
- Calls
LocalTZA(8640000007200000, false). - But
tis not a time value, because it's not in (-8640000000000000, 8640000000000000).
Similar, when new Date(NaN).setMilliseconds(0) is called, it invokes LocalTime and LocalTZA with t = NaN.
|
@littledan The difference between mathematical values and IEEE-754 numbers resp. it's safe-integer subset is, for once, not relevant. I think the test case for that issue was something like this. // Assume the local time offset is positive, let's say TZ=Europe/Berlin.
var d = new Date(8640000000000000); // d.[[DateValue]] = 8,640,000,000,000,000
d.setMilliseconds(0);20.3.4.23 Date.prototype.setMilliseconds ( ms )
20.3.1.9 UTC ( t )
Similar, when |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
apaprocki
Apr 4, 2018
Contributor
@anba I will incorporate this into my editorial cleanup of LocalTZA.
|
@anba I will incorporate this into my editorial cleanup of |
apaprocki
referenced a pull request that will
close
this issue
Apr 4, 2018
Open
Editorial: LocalTZA input specification #1160
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
The text in #1160 looks good to me! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jungshik
May 15, 2018
Contributor
The fourth paragraph seems to imply that a daylight saving time offset is always positive. This is no longer true starting with tzdata2018a.
It's dropped but back in tzdata 2018e.
@anba, is your concern about the following ?
at a positive time zone transition (e.g. when the daylight saving time starts or the time zone adjustment is increased due to a time zone rule change)
at a negative time zone transition (e.g. when the daylight saving time ends or the time zone adjustment is decreased due to a time zone rule change)
It's dropped but back in tzdata 2018e. @anba, is your concern about the following ?
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
apaprocki
May 15, 2018
Contributor
@jungshik I added an explicit statement covering this in my PR:
https://github.com/tc39/ecma262/pull/1160/files#diff-3540caefa502006d8a33cb1385720803R27507
|
@jungshik I added an explicit statement covering this in my PR: https://github.com/tc39/ecma262/pull/1160/files#diff-3540caefa502006d8a33cb1385720803R27507 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@jungshik |
anba commentedJan 17, 2018
In addition to the fixes in #1053:
Some sentences should be simplified/split-up so they're easier to understand. For example instead of
"LocalTZA( t, isUTC ) is an implementation-defined algorithm that must return a number representing milliseconds suitable for adding to a Time Value."
we could just as well just write:
"LocalTZA is an implementation-defined algorithm that returns the local time zone offset in milliseconds."
<dfn>seems to be used incorrectly a number of times (i.e. it's not used to define a term, but merely to change the formatting).LocalTZA's
tparameter is described as a time value. This is incorrect,tcan be a number value outside of the allowed range for time values.The fourth paragraph seems to imply that a daylight saving time offset is always positive. This is no longer true starting with tzdata2018a.