Skip to content
A jQuery plugin for detect_timezone.js
Latest commit 32e5db8 Feb 7, 2013 @scottwater better IE7 support :(
Failed to load latest commit information.
detect_timezone.js initial commit Sep 4, 2011
example.htm initial commit Sep 4, 2011
jquery.detect_timezone.js better IE7 support :( Feb 7, 2013 initial commit Sep 4, 2011

jQuery Detect TimeZone Plugin

This jQuery plugin leverages Jon Nylander's jstimezonedetect (based on work by Josh Fraser).


There are plenty of javascript examples out there showing how to work with the timezone offset. Unfortunately this approach has some disadvantages, especially in regards to day light savings.

Determining timezones using javascript is not trivial out of the box. Different browsers use different acronyms and conventions for representing names of timezones, it also differs depending on the user's operating system.

How to use

First, add the required scripts to your page (jquery, detect_timezone.js, and jquery.detect_timezone.js)

Then use one of the two timezone functions.

  1. set_timezone - sets the current timezone value by calling .val on the selector. This generally assumes the selector is an input (text or hidden).
  2. get_timezone - this method will return the current Olson timezone name.


  • debug - defaults to false. When true, it let you know that for some reason a timezone could not be found.
  • default - allows you to set a default value in the case no timezone could be found. Defaults to 'America/New_York'


                'default' : 'America/Los_Angeles'

Note: There is an extremely minimal example in this repository.


Blah, blah, blah....use it, tweak it, etc.

Always feel free to drop me a line at scottwater@gmail, but please use GitHub issues for any bugs/etc.

Something went wrong with that request. Please try again.