Is there a way to change your timezone in Chrome devtools?

后端 未结 4 1488
慢半拍i
慢半拍i 2021-02-06 21:38

I\'ve created a tool in JavaScript that determines the current UTC time and checks if another predetermined date has passed yet.

I\'d like to change my browser to anoth

相关标签:
4条回答
  • 2021-02-06 21:51

    To do this in Chrome Dev tools you can use the Geolocation sensor emulation. Go to the 3 dotted menu, More Tools and Sensors.

    There's a Geolocation dropdown with some common locations but you can change your preferred one as well. To do that you can choose Other... in that dropdown and enter a custom Timezone ID

    Here's a demo page to test it: https://mathiasbynens.be/demo/timezone and a video that shows the procedure: https://www.youtube.com/watch?v=pIpN_AuV4AI

    0 讨论(0)
  • 2021-02-06 21:51

    Very Simply

    Chrome uses the timezone that comes from the operating system.

    So, just go into your system preferences and change your timezone.


    From the comments, credit to @Barmar

    0 讨论(0)
  • 2021-02-06 21:59

    There's no way yet to do this from the DevTools, but I've filed a feature request to implement a way to override the timezone.

    In the meantime, you can launch the browser with the TZ environment variable set to the desired timezone name on Linux/MacOS.

    0 讨论(0)
  • 2021-02-06 22:11

    This worked for me in windows 10. change the system timezone and refresh the page.

    0 讨论(0)
提交回复
热议问题