Closed Bug 802627 Opened 12 years ago Closed 7 years ago

JavaScript Date.toString function generates incorrect time zone from Epoch (milliseconds=0) to less-than-Offset (17999999 in America/New_York)

Categories

(Core :: JavaScript Engine, defect)

15 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jschortz2, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
Build ID: 20120905151427

Steps to reproduce:

Sample code:
var d1=new Date(parseInt(document.forms[0].myDate1.value,10));
alert(d1.toString());

Input is a value from 0 (the Epoch) to 17999999 (less than my UTC offset, in Eastern time zone, i.e. America/New_York)


Actual results:

When input is zero, output from alert is "Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Daylight Time).  DAYLIGHT!!!


Expected results:

Daylight savings time indication should be STANDARD.  This happens for the entire range of input from 0 to 17999999.  When input is <=(-1) or >=18000000, i.e. <Epoch or >=my UTC offset in milliseconds, the correct ("Standard") daylight indicator is displayed
Could you provide a small html testcase, please.
Attached file test case
Test case of what I used to generate the error.
Attachment #672392 - Attachment mime type: text/plain → text/html
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Assignee: general → nobody
Fixed in https://hg.mozilla.org/mozilla-central/rev/b7ef07909cc4


Before (Win10):
new Date(0).toString()
"Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Daylight Time)"

After (Win10):
new Date(0).toString()
"Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Standard Time)"
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.

Attachment

General

Creator:
Created:
Updated:
Size: