Pages

Javascript Date getTimezoneOffset() Method

Description:

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.

Syntax:

Date.getTimezoneOffset()
Here is the detail of parameters:
  • NA

Return Value:

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

Example:

<html>
<head>
<title>JavaScript getTimezoneOffset Method</title>
</head>
<body>
<script type="text/javascript">
   var dt = new Date();
   var tz = dt.getTimezoneOffset(); 
   document.write("getTimezoneOffset() : " + tz ); 
</script>
</body>
</html>
This will produce following result for Indian time zone:
getTimezoneOffset() : -330 
 
 
+JavaScript +JavaScript Frameworks Links +Javascript Development 
+JavaScript's and More, Software and Marketing +JavascriptU +JavaScriptOn 
+Javascript Problems +JavaScriptOn 
 +javaScript is a creek in West Virginia in the summe 
  
 

No comments:

Flag Counter
| Copyright © 2013 Remote Tutor