home / software / tips and tricks / How can I get the Timezone information using Javascript

How can I get the Timezone information using Javascript

Updated:  02/06/2012 12:02 PM
Author:  Shiju Mathews

Status:    Resolved.


The getTimezoneOffset() method returns the time difference between Greenwich Mean Time (GMT) and local time, in minutes.

For example, If your time zone(Italy) is GMT+1, +60 will be returned.

Syntax

Date.getTimezoneOffset()

Sample Code


Result:

When the request is from Tampa, Florida result is

'The local time zone is: GMT -5'
Tags: How can I get the Timezone information using Javascript
Updated on: October 2024