New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 722738 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocked on:
issue v8:6031



Sign in to add a comment

getTimezoneOffset() returns incorrect values in Asuncion time zone

Reported by mak07020...@gmail.com, May 16 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Steps to reproduce the problem:
1. Set OS time zone to Asuncion
2. Call "new Date(2018, 2, 31).getTimezoneOffset()" on the console. Note this date (March 31, 2018) is outside DST.

What is the expected behavior?
240 should be returned, since DST in Asuncion starts on the 1st Sunday of October and ends on the 4th Sunday of March (see https://www.timeanddate.com/time/change/paraguay/asuncion).

What went wrong?
180 is returned, which means that the JS engine thinks this date to be inside DST.

Did this work before? N/A 

Chrome version: 58.0.3029.110  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 

Comment 1 by bokan@chromium.org, May 16 2017

Components: -Blink Blink>JavaScript

Comment 2 by hdodda@chromium.org, May 17 2017

Cc: hdodda@chromium.org
Labels: Needs-Feedback
Tested the issue on windows 7 using chrome M58 #58.0.3029.110 and issue is reproduced.

Same behavior is seen in firefox browser also and attached screenshot for reference.

@mak07020702--- Could you please confirm if this has worked before or it is a feature request.

Thanks!
722738.PNG
335 KB View Download

Comment 3 by hpayer@chromium.org, May 18 2017

Mergedinto: 714301
Status: Duplicate (was: Unconfirmed)

Comment 4 by adamk@chromium.org, May 18 2017

Cc: adamk@chromium.org
Status: Untriaged (was: Duplicate)

Comment 5 by adamk@chromium.org, May 18 2017

Status: Unconfirmed (was: Untriaged)

Comment 6 by jochen@chromium.org, May 23 2017

Owner: adamk@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 7 by jochen@chromium.org, May 23 2017

Components: -Blink>JavaScript Blink>JavaScript>Internationalization
This isn't a duplicate of the bug that Hannes marked, as that bug is about the string-to-date parser, which isn't invoked here.

I can't reproduce the issue on Linux, in either Chrome or Firefox--I get the correct answer, 240, for both, in both browsers (as well as in ChakraCore and JSC).

I wonder if the issue is with the Windows timezone database. It looks like both V8 and SpiderMonkey make the same system calls, localtime_s/localtime_r (depending on the OS), to get at the timezone offset for the Date class.

Comment 9 by adamk@chromium.org, Jun 12 2017

Owner: ----
Status: Available (was: Assigned)
No action to be done here without more feedback from reporter.
@hdodda, I apologize for the late response.

I tried with an old version and the issue seems to reproduce. See the attached screen shot. Japanese letters mean Paraguay standard time.

Please note that whether the issue reproduces depends on the OS clock. When the OS clock is set to year 2015, the issue does not reproduce. Same behavior is seen in the latest version of Chrome as well.
screenshot.PNG
35.5 KB View Download

Comment 11 by adamk@chromium.org, Jun 15 2017

Labels: -Needs-Feedback
Owner: js...@chromium.org
Status: Assigned (was: Available)
jshin, can you take a look into this?

Comment 12 by js...@chromium.org, Jul 14 2017

Labels: Needs-Feedback
I suspect that this bug can be used to argue for enabling 'icu_time_zone' (what's the flag name exactly, I forgot) Dan added recently.  There are other bugs as well. 

I'm not on Windows. 

mak07020702,   can you post the results of the following two lines? Thanks 

new Date(Date.UTC(118, 2, 31, 12)).toLocaleString('en-US', 
      {timeZoneName: 'long', year: 'numeric', month: 'short',
        day: 'numeric', hour: '2-digit', minute: '2-digit'});


new Date(Date.UTC(118, 1, 1, 12)).toLocaleString('en-US', 
      {timeZoneName: 'long', year: 'numeric', month: 'short',
        day: 'numeric', hour: '2-digit', minute: '2-digit'});


Comment 13 by js...@chromium.org, Jul 14 2017

On Windows 7, I changed the tiemzone to America/Asuncion. 

I confirmed that Date.toString() is indeed broken on Windows with the timezone set to America/Asuncion. Or, toString() has a different idea of when DST ends from toLocaleString() in 2018 in America/Asuncion. 

> d2018mar31 = new Date(Date.UTC(2018,2,31,12))
Sat Mar 31 2018 09:00:00 GMT-0300 (Atlantic Daylight Time)

> d2018mar31 = new Date(Date.UTC(2018,2,31,12))
Sat Mar 31 2018 09:00:00 GMT-0300 (Atlantic Daylight Time)

"Mar 31, 2018, 8:00 AM Paraguay Standard Time"

---------------

new Date(Date.UTC(2018,2,31,12))
Sat Mar 31 2018 09:00:00 GMT-0300 (Atlantic Daylight Time)
new Date(Date.UTC(2018,3,21,12))
Sat Apr 21 2018 08:00:00 GMT-0400 (Atlantic Standard Time)
new Date(Date.UTC(2018,5,21,12))
Thu Jun 21 2018 08:00:00 GMT-0400 (Atlantic Standard Time)

------------------------

 IE 11 agrees with ICU ( used by Date.toLocaleString()):

> (new Date(Date.UTC(2018,2,31,12))).toString()
"Sat Mar 31 2018 08:00:00 GMT-0400 (Paraguay Standard Time)"


Comment 14 by js...@chromium.org, Jul 14 2017

> "Mar 31, 2018, 8:00 AM Paraguay Standard Time"

The above is the output of 

d2018mar31.toLocaleString('en-US', 
      {timeZoneName: 'long', year: 'numeric', month: 'short',
        day: 'numeric', hour: '2-digit', minute: '2-digit'});

Comment 15 by js...@chromium.org, Jul 14 2017

Blockedon: v8:3547

Comment 16 by js...@chromium.org, Jul 14 2017

Blocking: v8:6031

Comment 17 by js...@chromium.org, Jul 20 2017

Blocking: -v8:6031

Comment 18 by js...@chromium.org, Jul 20 2017

Blockedon: v8:6031

Comment 19 by js...@chromium.org, Oct 13 2017

This was fixed but later the fix was reverted. (see https://chromium-review.googlesource.com/713404 ). 


Blockedon: -v8:3547
Status: Fixed (was: Assigned)
From comment 8:

> I wonder if the issue is with the Windows timezone database. It looks like both V8 and SpiderMonkey make the same system calls, localtime_s/localtime_r (depending on the OS), to get at the timezone offset for the Date class.


I agree with Dan here. However, comment 15 (setting the system time to year 2015 fixed the problem) is strange. 

Anyway, turning on --icu-timezone-data should fix this issue. 

Because the standard timezone offset has remained the same (4 hours behind UTC) while the transition date changed over time (early April to late March), this issue wouldn't require fixing  bug v8:3547 . 



See https://bugs.chromium.org/p/chromium/issues/detail?id=283647#c17 if you want to get a fix right away. 

Sign in to add a comment