Closed Bug 292524 Opened 20 years ago Closed 20 years ago

Date.getTimezoneOffset() returns wrong offset after time zone is changed

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 285615

People

(Reporter: xiaodiwu, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3 After the browser launches (or at least after a javascript Date object is first initialized), the time zone is no longer updated to match the user's system in subsequent Date objects. As a result, Date.getTimezoneOffset() (as well as all other Date functions that return the time zone) return the wrong time zone if the user changes the time zone on the operating system after browser launch. Reproducible: Always Steps to Reproduce: 1. Launch Firefox 2. Load a page with some simple javascript that includes: now = new Date(); (This step may not be necessary) 3. Change time zone on operating system (i.e. from GMT-2 to GMT+10) 4. Without quitting Firefox, open a new window (or just the javascript console) and execute the javascript: now2 = new Date(); 5. Observe the time zone given in variable now2. Actual Results: The time zone given is the old one (in the example above, GMT-2) instead of the actual one (GMT+10). Expected Results: The time zone returned should be the current time zone on the user's system. IE6/Windows has a correct implementation. Marking severity as 'normal' because there is no apparent workaround.
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
*** This bug has been marked as a duplicate of 285615 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.