Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I test my browser timezone dependent application againts different timezones? [duplicate]

Tags:

I'm making a Javascript web application that depends on user's browser time zone.

For example, whenever I check the UTC offset, I find it to be +5.5 only.

How do I test if it works in other time zones as well? I specially want to see how it works with US time zones.

I use Firefox mostly. Is there any configuration setting I can edit? I tried changing my system time zone, but it didn't work.

like image 310
kapeels Avatar asked Feb 12 '11 06:02

kapeels


People also ask

How do you test web applications in different time zones?

To change the Chrome time zone for testing, follow the steps below: Open DevTools in Chrome -> Open the Console drawer. Click on the three-dotted menu -> Click on More tools -> Sensors. From the Sensors tab, set the location according to your preference and define the specific timezone.

How do you handle multiple time zones in your application?

I would suggest storing all times in UTC format. Perform all your calculations and algorithms with the UTC time. You only care about timezones for display purposes. For a particular user, convert the UTC time to their preferred timezone.

How do I check my timezone in Chrome browser?

Fortunately, it's easy to change the time zone displayed in Chrome. Click the Customize and Control (wrench) button and select Settings. When the Settings page appears, select the System tab. Go to the Date and Time section, pull down the Time Zone list, and select your current time zone.


1 Answers

You need to restart your browser after you change your system's timezone. Firefox keeps the original timezone, I believe, and Chrome thinks you are in UTC if you do not restart.

like image 95
Ben Belchak Avatar answered Oct 05 '22 02:10

Ben Belchak