Closed Bug 424867 Opened 16 years ago Closed 14 years ago

Change of time zone is not picked up by the browser

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 127246

People

(Reporter: osyed, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12

If the user interacts with the OS and changes the time zone. This change is not picked up by the FF browser until the user exits all open browser windows and restarts the browser. So if a web page has this Javascript in it:
  var d = new Date()
  alert(d.getTimezoneOffset())
reloading the web page after changing the time zone still shows the same value. In IE the new value is shown when the page is reloaded. In FF the the browser has to be completely shutdown and reopened for it to notice the change in time zones.

It would be nice if FF also updated the time zone offset by querying the OS when the page is reloaded. Or ideally every few seconds. Thanks.



Reproducible: Always

Steps to Reproduce:
1. Add this Java script to any page

<script language="JavaScript">
<!--
function setTimezone(){
  var d = new Date()
  var tz;

  tz = d.getTimezoneOffset();
  alert("my timezone offset is " + tz);
}

setTimeout("setTimezone()", 100);

//-->
</script>


2. Open the page in the FF browser.
3. Change the time zone on the computer using tools provided by the OS
4. Reload the page of step #2'
5. Notice that the time zone offset has not changed.
6. Exit all browser windows.
7. Open the browser and go back to the page; now the time zone has changed.

Actual Results:  
The time zone is updated but the browsers has not picked it up when the page is reloaded.


Expected Results:  
Browser should pickup the change when is ireload it when.

IE properly picks up the time zone change when the page is reloaded.
sure, just search and you will find this bug report 
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
I disagree that this is a duplicate of bug 127246. That bug report says that the wrong date was being returned in Javascript after changing the time zone. I am not saying that after I change the time zone in my OS the date returned in Javascript is wrong. I am saying that the browser does not notice the change in the time zone until I shutdown all open browser windows and open it again. It is as if the browser is reading the time zone from the OS only on initial start up.

Omar
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
To see this problem 

1. go to this URL:
   http://arimaa.com/arimaa/gameroom/tz.htm

2. change the time zone in your OS (I used WinXP) to something else.

3. reload the above URL.

Notice that FF still gives the same value for the time zone offset
when the page is reloaded after changing the timezone.

Only when you close all browser windows and reopen the browser, does
it notice that the time zone has changed.

It should show the new value when the page is reloaded. Or essentially
when getTimezoneOffset() is called again.
it's the same bug if you read bug 241276 and the whole bug 127246
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → DUPLICATE
Yes, I have read these bugs carefully.

Bug 241276 is also incorrectly marked as duplicate of bug 127246.

Notice comment #9 of bug 127246:
Confirming bug. We ran testcase #1 on rogerl's Win2K machine, and
no matter what timezone we set it to, we got Pacific Standard Time.
We were careful to relaunch Mozilla each time we changed the timezone.

In bug 127246 relaunching Mozilla still gave the wrong time.

What this bug and bug 241276 are saying is that relaunching Mozilla
is the only way to get it to notice that the timezone settings in
the OS have changed.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
note: it is possible that the Suite's launcher will need to be restarted for it to reload the timezone in bug 127246 and this bug is a duplicate of bug 127246.
Possible ways to fix this for Windows are to re-read the time when we receive WM_TIMECHANGE (not sure how this would work when the timezone is changed and the time is the same) or use RegNotifyChangeKeyValue on HKLM\System\CurrentControlSet\Control\TimeZoneInfo rmation\ActiveTimeBias. Also, it seems that W2K does not broadcast WM_TIMECHANGE when the timezone changes automatically for PST / DST.
Assignee: nobody → general
Component: OS Integration → JavaScript Engine
Product: Firefox → Core
QA Contact: os.integration → general
do you still see this using newest version? 
If you do not, please close the bug with resolution set to WORKFORME (or INVALID if you determined the fault was not in firefox)
Whiteboard: [closeme 2010-10-01]
(In reply to comment #8)
> do you still see this using newest version? 
> If you do not, please close the bug with resolution set to WORKFORME (or
> INVALID if you determined the fault was not in firefox)

This bug appears to be partially fixed in firefox (tested with version 3.6.8). Reloading the page does cause it to see the change in the time zone, but a call to the Date() function does not.

To see this problem 

1. go to this URL:
   http://arimaa.com/arimaa/gameroom/tz.htm

2. change the time zone in your OS (I used WinXP) to something else.

3. click the 'Timezone' button. Notice that it still displays the old time zone offset.

4. click the 'Reload' button of the browser. Notice that it now displays the new time zone offset. Previously this also caused it to display the old time zone offset.

If you go to the above URL with IE and repeat the steps you will notice that IE notices the change in the time zone offset at step 3 when the 'Timezone' button is clicked.

To completely fix this bug a call to Date() must cause the browser to check the time zone offset.
Per comment 9, only remaining issue is a dupe of bug 127246, all others have now been fixed.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago14 years ago
Resolution: --- → DUPLICATE
Whiteboard: [closeme 2010-10-01]
This bug is still reproducible on last version of FF.
Could anyone please fix it ASAP? :)
You need to log in before you can comment on or make changes to this bug.