Closed Bug 819820 Opened 12 years ago Closed 7 years ago

Date.toString() displays wrong timezone name in the hour following the end of DST

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mjh563, Unassigned)

Details

In the Europe/London timezone, the timezone name displayed by Date.toString() is incorrect during the hour after daylight saving time (BST/UTC+1) ends. 

For example, in 2012 it ended at 1am UTC (2am BST) on 28 October, but Firefox displays the timezone as BST instead of GMT for a further hour.

Steps to reproduce:

1. Set system timezone to Europe/London.
2. Run the following in the web console:

> new Date(Date.UTC(2012,9,28,0,59,59))  //00:59:59 UTC - last second of BST
Sun Oct 28 2012 01:59:59 GMT+0100 (BST)  //correct

> new Date(Date.UTC(2012,9,28,1,0,0))    //01:00:00 UTC - first second of GMT
Sun Oct 28 2012 01:00:00 GMT+0000 (BST)  //wrong - should be (GMT)

> new Date(Date.UTC(2012,9,28,1,59,59))  //01:59:59 UTC
Sun Oct 28 2012 01:59:59 GMT+0000 (BST)  //wrong - should be (GMT)

> new Date(Date.UTC(2012,9,28,2,0,0))    //02:00:00 UTC
Sun Oct 28 2012 02:00:00 GMT+0000 (GMT)  //correct

Note that the numerical offset is correct (GMT+0000), it's just the timezone name that's wrong.

I'm using Debian 6.0 (squeeze) and Firefox 18 beta.
Assignee: general → nobody
Fixed in https://hg.mozilla.org/mozilla-central/rev/b7ef07909cc4


Before (Ubuntu):
new Date(Date.UTC(2012,9,28,1,0,0)).toString()
"Sun Oct 28 2012 01:00:00 GMT+0000 (BST)"

new Date(Date.UTC(2012,9,28,1,59,59)).toString()
"Sun Oct 28 2012 01:59:59 GMT+0000 (BST)"


After (Ubuntu):
new Date(Date.UTC(2012,9,28,1,0,0)).toString()
"Sun Oct 28 2012 01:00:00 GMT+0000 (GMT)"

new Date(Date.UTC(2012,9,28,1,59,59)).toString()
"Sun Oct 28 2012 01:59:59 GMT+0000 (GMT)"
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.