Closed
Bug 63720
Opened 24 years ago
Closed 8 years ago
setMinutes(), getTimezoneOffset() correct in GMT+ timezones?
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: pschwartau, Unassigned)
References
Details
Note the behavior of setMinutes() and getTimezoneOffset() when I advance my WinNT system clock from Pacific Standard Time to London, then to Casablanca. On WinNT, Casablanca and London both say they are GMT = 0, yet the return values of both the above methods differ between them. I am not yet able to decipher the ECMA requirement for the return value of setMinutes(). If there is supposed to be something different between the Casablanca and London timezones, OK - but then why does the Pacific timezone give the same setMinutes() result as London does: 1020755220000? Whereas in Casablanca, setMinutes() gives 1020758820000 (one hour ahead)? Notes; in the following, UTC_2000_JAN_01 = 946684800000. When we apply setMinutes(), we use a parameter of 1234567. This advances the date from UTC_2000_JAN_01 to a date of May 07, 2002. Of course, this means Daylight Savings Time will come into play... PACIFIC STANDARD TIME (GMT -8) ******************************************* new Date(): Mon Dec 25 13:00:30 GMT-0800 (Pacific Standard Time) 2000 new Date().getTimezoneOffset()/60 8 DateCase = new Date(UTC_2000_JAN_01) Fri Dec 31 16:00:00 GMT-0800 (Pacific Standard Time) 1999 DateCase.setMinutes(1234567) 1020755220000 DateCase.getTime() 1020755220000 DateCase Tue May 07 00:07:00 GMT-0700 (Pacific Daylight Time) 2002 DateCase.getTimezoneOffset()/60 7 DateCase.getUTCHours() 7 LONDON (GMT 0) ******************************************* new Date(): Mon Dec 25 21:01:17 GMT+0000 (GMT Standard Time) 2000 new Date().getTimezoneOffset()/60 0 DateCase = new Date(UTC_2000_JAN_01) Sat Jan 01 00:00:00 GMT+0000 (GMT Standard Time) 2000 DateCase.setMinutes(1234567) 1020755220000 DateCase.getTime() 1020755220000 DateCase Tue May 07 08:07:00 GMT+0100 (GMT Daylight Time) 2002 DateCase.getTimezoneOffset()/60 -1 DateCase.getUTCHours() 7 CASABLANCA (GMT 0) ******************************************* new Date(): Mon Dec 25 21:02:14 GMT+0000 (Greenwich Standard Time) 2000 new Date().getTimezoneOffset()/60 0 DateCase = new Date(UTC_2000_JAN_01) Sat Jan 01 00:00:00 GMT+0000 (Greenwich Standard Time) 2000 DateCase.setMinutes(1234567) 1020758820000 DateCase.getTime() 1020758820000 DateCase Tue May 07 08:07:00 GMT+0000 (Greenwich Standard Time) 2002 DateCase.getTimezoneOffset()/60 0 DateCase.getUTCHours() 8
Reporter | ||
Comment 1•24 years ago
|
||
Reassigning Mike's JS Engine bugs to Patrick, as per recent meeting -
Assignee: mike+mozilla → beard
Comment 2•23 years ago
|
||
Marking future.
Summary: setMinutes(), getTimezoneOffset() correct in GMT+ timezones? → setMinutes(), getTimezoneOffset() correct in GMT+ timezones?
Target Milestone: --- → Future
Updated•22 years ago
|
Severity: normal → minor
Comment 3•20 years ago
|
||
Possibly dup'd by bug 173431 ? From rod.whiteley@gmail.com's post at news://news.mozilla.org:119/ci6tfq$4kv2@ripley.netscape.com, it seems that rogue TZ setting can mess up Windows localtime. /be
OS: All → Windows NT
Hardware: All → PC
Updated•20 years ago
|
Assignee: beard → general
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Comment 5•8 years ago
|
||
No longer reproducible, because Morocco observes daylight savings since 2008 and we don't track historical time zones. >> DateCase = new Date(UTC_2000_JAN_01) Date 2000-01-01T00:00:00.000Z >> DateCase.toString() "Sat Jan 01 2000 00:00:00 GMT+0000 (Morocco Daylight Time)" >> DateCase.setMinutes(1234567) 1020755220000 >> DateCase.getTime() 1020755220000 >> DateCase.toString() "Tue May 07 2002 08:07:00 GMT+0100 (Morocco Standard Time)" >> DateCase.getTimezoneOffset()/60 -1 >> DateCase.getUTCHours() 7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•