jsTimezoneDetect /

How do I use jsTimezoneDetect?

Include the latest minified version on a web page, then:

var settings = {
    blocking : true,
    geoloc : false,
    ip : false,
    callback : function(timezone) {; // "Europe/Berlin"
        timezone.dst(); // true
        timezone.offset(); // 60 (minutes)

jstz.determine(settings); // Starting point

What does it do?


The script uses JavaScript to give you an Olson timezone key which represents the timezone setting of the user's computer


Optionally, it uses IP and/or geolocation to improve the precision of the timezone detected in step 1. IP and geolocation detection results have lower priority than step 1 (the client's computer setting should always win).

How do I test this script?

To test the detection script, simply change your system timezone and refresh this page. In some browsers you will have to open a new tab, or even restart for a new timezone to take effect.

Bugs, suggestions and praise...

...happily received by Jon Nylander at

jsTimezoneDetect is open source, so feel free to contribute.


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.