Closed Bug 1342853 Opened 8 years ago Closed 6 years ago

getTimezoneOffset() returns incorrect values in Brasilia time zone

Categories

(Core :: JavaScript Engine, defect, P3)

52 Branch
All
Windows
defect

Tracking

()

RESOLVED DUPLICATE of bug 1346211

People

(Reporter: m1miyaza, Unassigned)

References

Details

(Keywords: triage-deferred)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 Build ID: 20170223185858 Steps to reproduce: In Brasilia time zone, offset is 3 hours. The API getTimezoneOffset() returns 180. The Daylight Saving Time starts on the third Sunday in October and ends on the third Sunday in February. During DST, the time zone offset is 2 hours and getTmezoneOffset() returns 120. Below JavaScript code checks the time zone offset around DST boundary dates in Brasilia time zone. (new Date(2017,9,14,12,0,0)).getTimezoneOffset() --> returns 180 (new Date(2017,9,15,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2018,1,17,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2018,1,18,12,0,0)).getTimezoneOffset() --> returns 180 Actual results: getTimezoneOffset() returns incorrect value around October 21, 2018 when DST starts in Brasilia time zone. (new Date(2018,9,20,12,0,0)).getTimezoneOffset() --> returns 120 which is incorrect, should return 180 (new Date(2018,9,21,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2019,1,16,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2019,1,17,12,0,0)).getTimezoneOffset() --> returns 180 It also returns incorrect values around October 20, 2019 and October 18, 2020. (new Date(2019,9,19,12,0,0)).getTimezoneOffset() --> returns 120 which is incorrect, should return 180 (new Date(2019,9,20,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2020,1,15,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2020,1,16,12,0,0)).getTimezoneOffset() --> returns 180 (new Date(2020,9,17,12,0,0)).getTimezoneOffset() --> returns 120 which is incorrect, should return 180 (new Date(2020,9,18,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2021,1,20,12,0,0)).getTimezoneOffset() --> returns 120 (new Date(2021,1,21,12,0,0)).getTimezoneOffset() --> returns 180 Expected results: (new Date(2018,9,20,12,0,0)).getTimezoneOffset() --> should return 180 (new Date(2019,9,19,12,0,0)).getTimezoneOffset() --> should return 180 (new Date(2020,9,17,12,0,0)).getTimezoneOffset() --> should return 180
OS: Unspecified → Windows
Hardware: Unspecified → All
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Expected result on Xubuntu. Issue is similar to bug 1330307.
See Also: → 1330307
Keywords: triage-deferred
Priority: -- → P3
Blocks: 285663
Dup'ing forward to bug 1346211 which should have fixed this problem. Please reopen if the issue is still present. Thanks!
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.