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?
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?
Share Improve this question edited Jul 15, 2023 at 15:48 Super Kai - Kazuya Ito 1 asked Jan 15, 2017 at 23:29 jonhobbsjonhobbs 28k37 gold badges118 silver badges177 bronze badges 4- 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: stackoverflow.com/a/31379288/2100627 – southrop Commented Jan 16, 2017 at 2: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 Commented Jan 16, 2017 at 3:16
- Hmm, I'm not doing anything except using standard javascript date functions. I restarted Chrome but didn't restart my PC. – jonhobbs Commented Jan 16, 2017 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 Commented Jan 17, 2017 at 17:53
4 Answers
Reset to default 5You 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.
The webrowser's local comes from the OS settings.
On windows 10 it's:
- Right click on the time/date widget at the windows start bar. (Or go to the Settings app and look for "Date & time")
- Uncheck boxes for automatic time and time-zone setting
- Manually set the new time-zone
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
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