11

This should be easy but for the life of me I can't work it out.

I want to try testing some javascript timezone stuff and I need to put my browser into a different timezone, I'm in the UK so it's set to GMT which in the winter just happens to be the same as UTC so working out whether the difference has been accounted for is impossible.

I'd like to put my PC into EST for example but I can't find anything in Chrome options and I've tried changing my timezone in Win10 options but the browser ignores it. Restarting Chrome doesn't help, even though my PC is sure it's in EST and the clock in my Windows toolbar has changed.

I'm sure I'm just being an idiot here but can anybody help?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
jonhobbs
  • 26,684
  • 35
  • 115
  • 170
  • 1
    Normally changing your computer timezone should change the timezone that Chrome uses. Perhaps your code is using a non-standard way of obtaining the timezone? You could try mocking the timezone(s) you want using this method though: http://stackoverflow.com/a/31379288/2100627 – southrop Jan 16 '17 at 02:48
  • @southrop—that answer may change the value returned by *getTimezoneOffset*, but it will not change the offset used by the implementation in calculations since it doesn't change the offset value. – RobG Jan 16 '17 at 03:16
  • Hmm, I'm not doing anything except using standard javascript date functions. I restarted Chrome but didn't restart my PC. – jonhobbs Jan 16 '17 at 20:39
  • You don't need to restart your PC, or Chrome. Changing your time zone in the OS should carry through. If it doesn't then you might have the "Set Time Zone Automatically" feature turned on in Win 10, which would change it back. – Matt Johnson-Pint Jan 17 '17 at 17:53

4 Answers4

4

The webrowser's local comes from the OS settings.

On windows 10 it's:

  1. Right click on the time/date widget at the windows start bar. (Or go to the Settings app and look for "Date & time")
  2. Uncheck boxes for automatic time and time-zone setting
  3. Manually set the new time-zone

web browser time, date and timezone settings are based on windows 10 "Date &Time" settings

Matthew C
  • 616
  • 3
  • 10
  • 18
1

You can test timezones in Chrome by setting it up in the Sensors tab in DevTools. In case you haven't opened it so far it is you need to go through:

  • Customize and control DevTools (Three dots aka hamburger icon) -> More Tools -> Sensors and finally Location.

enter image description here

  • Does anybody know the reference lookup for the Timezone ID ? (what are the valid string values ?) – joedotnot Apr 23 '22 at 20:11
  • 1
    @joedotnot I believe you want this list https://en.wikipedia.org/wiki/List_of_tz_database_time_zones – pabo Jun 16 '22 at 16:52
-1

If got in the same problem, while using Kibana, the Timezone still stuck in UTC.

I used this extension below and worked like a charm:

TimeZone

Luiz Vaz
  • 1,669
  • 1
  • 19
  • 32
-5

You can verify Moment.js at the following link ( you can download it from here): http://momentjs.com/

There is more information on this on this discussion: Moment.js: Format date in a specific timezone

I hope that helps

Community
  • 1
  • 1
Athena
  • 1
  • 1