How to simulate different timezones in Chrome
Jul 13, 2025 am 12:19 AMTo test page behavior in different time zones in Chrome browser, there are three ways to do it. 1. Use Chrome DevTools to simulate the time zone: Open DevTools → Click Three Dots → More Tools → Sensors, check the overwrite option in the Date and Time section and select the target time zone. This setting only takes effect in the current session; 2. Specify the time zone through the command line startup parameters: After closing all Chrome instances, execute chrome.exe --timezone="target time zone" to affect the entire browser instance; 3. Use JavaScript to overwrite the behavior of the Date object. Fixed time values are used to accurately control the JS time logic, suitable for debugging and automated testing. Just choose the appropriate method according to the usage scenario.
Want to test page behavior in different time zones in Chrome browser? In fact, the method is quite straightforward, especially suitable for international projects or debugging cross-regional functions. There is no need to install particularly complicated tools, just use the functions and some tips that come with the browser.

Simulate time zones with Chrome DevTools
Chrome's own developer tools (DevTools) support temporary modification of the browser's time zone, which is very useful for front-end debugging.
- Open DevTools: Shortcut key
F12
or right-click the page to select "Check" - Click the three dots in the upper right corner → More Tools → Sensors
- Check "Override Geolocation" and "Override Date/Time" in the Date and Time section
- After checking, a drop-down box will appear, where you can directly select the time zone, such as Asia/Shanghai, America/New_York, etc.
Note: This setting only takes effect in the current DevTools session. Refreshing the page will retain the time zone you selected, but after closing DevTools, the default will be restored.
![]()
Specify the time zone through command line startup parameters
If you want the entire browser instance to run in a specific time zone instead of just emulating in DevTools, it can be done by starting parameters.
- Close all Chrome instances
- Find the installation path of Chrome (usually
C:\Program Files\Google\Chrome\Application\chrome.exe
under Windows) - Execute the command:
chrome.exe --timezone="Asia/Tokyo"
You can replace "Asia/Tokyo"
with any IANA-supported time zone name.

This method is suitable for Windows, macOS, and Linux, but requires permission to start the browser from the command line. In addition, this method will affect the behavior of the entire browser, not just the current page.
Temporary simulation time with JavaScript
Sometimes you want to control the time objects obtained by JS, rather than the system time of the entire browser. At this time, you can use code to overwrite the behavior of the Date object.
For example:
const originalDate = Date; Date = class extends Date { constructor(...args) { if (args.length === 0) { super('2025-04-05T12:00:00Z'); // Fix one time} else { super(...args); } } };
After writing this way, any place where new Date() is called will return the time you set, which is equivalent to forcing the "deception" page to think that now is a certain point in time. Suitable for automated testing or temporary debugging.
Basically these are the methods. Choose the right method according to your needs: simple debugging is the most convenient; long-term testing can be done using the command line; precise control of JS time logic depends on code rewriting Date. Several methods are not complicated, but they are particularly practical in actual development.
The above is the detailed content of How to simulate different timezones in Chrome. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To prevent Chrome from automatically updating on Mac, it can be done by disabling update services, modifying permissions, and restricting network access. 1. Use terminal commands to disable the GoogleSoftwareUpdate daemon to prevent background updates; 2. Modify update directory permissions to prevent Chrome from starting the update process by itself; 3. Restrict Chrome's outbound network connection through system firewall or third-party tools to further eliminate update requests. Using these methods in combination can effectively prevent Chrome from being automatically updated.

When Chrome spelling check fails, you can troubleshoot and fix it by following the following steps: 1. Confirm that the "Use Spelling Check" function is enabled and check whether the corresponding language is enabled in the language settings; 2. Adjust the input language order, delete the redundant language, and ensure that the main language enables spelling check; 3. Close possible conflicting extensions, especially syntax or translation plug-ins; 4. Update Chrome to the latest version and check the operating system updates. If it still doesn't work, try resetting Chrome settings.

To clear the HSTS cache in Chrome, visit the chrome://net-internals/#hsts page, find the "Deletedomainssecuritypolicies" section, enter the target domain name and click "Delete". 1. Open Chrome's HSTS management page; 2. Enter the domain name in "Deletedomainsecuritypolicies" and delete it; 3. Test whether it is successful and try to access the website through http://. Note: This operation only deletes the HSTS rules for specific domain names. If you revisit the website via HTTPS, the browser may enable HSTS again. For inaccessible

To let Chrome download directly instead of opening it when clicking on the PDF link, 1. Enter chrome://settings/content/pdfDocuments to check "DownloadPDFfilesinsteadofautomatically opening theminChrome"; 2. Check whether there are plug-ins such as Lightpdf or Smallpdf interfering behavior, you can try to disable the test; 3. You can use the developer tools to copy the link and paste the new tag to trigger the download. The above methods can be selected according to the situation.

The problem of Chrome automatically popping up new tabs is usually caused by malicious extensions, advertising scripts, or browser hijacking. The solutions are as follows: 1. Check and uninstall suspicious extensions, especially ad-class plug-ins; 2. Clear browser caches and cookies to eliminate data corruption; 3. Check whether the homepage and default search engine settings have been tampered with and manually corrected; 4. Use antivirus software such as WindowsDefender or Malwarebytes to scan and clear potential malware; 5. Finally, try resetting Chrome settings to restore the default configuration. Troubleshooting in this order can effectively solve most abnormal labeling problems.

The screen tear occurs when the Chrome browser scrolls, which is usually caused by the out-of-synchronization of rendering and refresh. The solutions are as follows: 1. Ensure that hardware acceleration is enabled, you can manually check the settings and restart the browser; 2. Forcefully enable Compositor and related options to optimize rendering; 3. Check the display refresh rate, use single-screen testing, and enable VSync or adaptive synchronization technology on supported devices; 4. Update the graphics card driver or replace the display interface such as using the DP interface. It is recommended to start the troubleshooting with simple steps and gradually adjust to find the best configuration.

The problem of Chrome sync stuck can be solved through the following steps: 1. Check the network connection and Google account status to ensure normal access; 2. Log out and log in to the Chrome account again; 3. Clear the synchronized data and restart the browser; 4. Reset Chrome settings; 5. Try the traceless mode or new user profile. Sequentially checking can effectively restore the synchronization function.

1. Check whether the shortcut attribute has additional parameters and delete it; 2. Clear cache and switch startup settings, or create new user information; 3. Extend the impact and disable the problem plug-in through traceless mode. Chrome pops up new windows instead of tabs usually due to exceptions in shortcut parameters, cache configuration conflicts, or third-party extension interference. Check and adjust the corresponding settings in turn to resolve.
