-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Jasmine suite lib_date_test.js is failing in Chrome 67 #2743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's super strange... thanks for bringing it up, I'll look into it. Another clue: I get a different error than you get, but I think for all the same ancient dates. Yours are off by 32 seconds, mine by only 2 seconds! |
The distortion happens about noon on November 18, 1883 - exactly when time zones took effect in the US. My working hypothesis is that Chrome started using the computer's exact location, rather than simply its present-day time zone, to determine the time zone offset before this moment (update: not quite that precise: 15 miles west of here, which corresponds to about 80 seconds, has the same offset as I do). Note that Chrome 67 also now correctly identifies that in Boston, daylight saving time was not observed before 1918, so this seems to be part of a broader "enhancement" of Chrome's date handling logic. Unfortunately, they seem to have made the decision to set the actual offset between each location's time and UTC to the second, but the function So our hack to remove timezones: Lines 138 to 141 in e7896e9
is off by some semi-random integer number of seconds. It looks like I can fix this by comparing Date.getSeconds() with Date.getUTCSeconds() . I suppose I have to bring in Date.get[UTC]Minutes() as well and compare it to the timezone offset, since I don't know how they're rounding - clearly not +/-30 sec since @etpinard sees 32 seconds off, but I don't know if it's 0-59 seconds, or -10 to 49, or...?
|
Note that this does have consequences. This plot works correctly:
but these two, which should be identical to the above, are both shifted by some seconds:
|
Fix #2743 - old date timezone precision in Chrome 67+
fails on
Google Chrome 67.0.3396.79
on my Ubuntu 16.04 laptop with:But works fine in FF60, and used to work fine in Chrome 66.
@alexcjohnson have you noticed this?
The text was updated successfully, but these errors were encountered: