Closed Bug 1147872 Opened 10 years ago Closed 9 years ago

Date.toLocaleString() output uses wrong timezone/dst info

Categories

(Core :: JavaScript: Internationalization API, defect)

36 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: utrash, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20150320202338 Steps to reproduce: new Date().toString(); new Date().toLocaleString(); Actual results: // Thu Mar 26 2015 16:53:21 GMT+0300 (Russia TZ 2 Standard Time) - correct // 26.03.2015, 17:53:21 - wrong Expected results: toLocaleString() is expected to produce 26.03.2015, 1*6*:53:21 tested in IE11, Opera 28, Chrome 41 - all process toLocaleString correctly: 26.03.2015, 16:53:21
Component: Untriaged → JavaScript: Internationalization API
Product: Firefox → Core
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 The bug is still present. Need fix.
This is due to the 2014 base offset change from +4 to +3 in Moscow, and similar changes across Russia. http://www.timeanddate.com/news/time/russia-abandons-permanent-summer-time.html On Windows this was implemented with this: https://support.microsoft.com/en-us/kb/2998527 Apparently, Firefox is not using the same time zone conversion routines for toLocaleString that it does for other methods like toString and getTimezoneOffset? Those routines correctly pick the +3 offset, while toLocaleString is picking +4 erroneously. See also: http://stackoverflow.com/questions/33083936/convert-date-to-local-time-zone-with-tolocalestring-method-firefox
Essentially the same with US setup for it gets time zone name wrong. I'm in US - EDT now and Date().toLocaleString() gives FF: Mon Oct 12 2015 13:13:42 GMT-0400 (Eastern Standard Time) **** WRONG **** Chrome: Mon Oct 12 2015 13:19:30 GMT-0400 (Eastern Daylight Time) Opera: Mon Oct 12 2015 13:22:16 GMT-0400 (Eastern Daylight Time) Safari(win): Mon Oct 12 2015 13:22:36 GMT-0400 (Eastern Daylight Time) NB: US Ends daylight time Nov 1 so you won't see the error again until April. I would guess similar problem worldwide.
The issue from comment #0 is no longer reproducible in Firefox 45 (or later), because Fx45 uses a newer ICU release which contains the necessary updates for the Russian time zones (bug 1210165). Therefore resolving the issue as works-for-me. comment #2 is on the right track: toString and getTimezoneOffset queries the OS to retrieve the necessary time zone informations, whereas toLocaleString uses the ICU library which is shipped with Firefox. That means when the OS manufacturer updates the time zone infos for its OS, Date.prototype.toString can use these updates right away. But for toLocaleString, we need to update Firefox, or rather the ICU version currently used in Firefox (but that may change: bug 837961, bug 1299189). The issue from comment #3 is already tracked in bug 879261.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.