Tutorials Point

  JavaScript Basics
  JavaScript Objects
  JavaScript Advanced
  JS Useful References
  JS Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint

  Home     References     Discussion Forums     About TP  

Javascript Date getTimezoneOffset() Method

previous next AddThis Social Bookmark Button



Javascript date getTimezoneOffset() method returns the time-zone offset in minutes for the current locale. The time-zone offset is the minutes in difference, the Greenwich Mean Time (GMT) is relative to your local time.

For example, If your time zone is GMT+10, -600 will be returned. Daylight savings time prevents this value from being a constant.



Here is the detail of parameters:

  • NA

Return Value:

Returns the time-zone offset in minutes for the current locale.


<title>JavaScript getTimezoneOffset Method</title>
<script type="text/javascript">
   var dt = new Date();
   var tz = dt.getTimezoneOffset(); 
   document.write("getTimezoneOffset() : " + tz ); 

This will produce following result for Indian time zone:

getTimezoneOffset() : -330 

To understand it in better way you can Try it yourself.

previous next Printer Friendly