JavaScript getTimezoneOffset

JavaScript getTimezoneOffset function is one of the Date Functions, which returns the time zone offset of a given date in minutes. The syntax for this getTimezoneOffset function is:

 Date.getTimezoneOffset()

JavaScript getTimezoneOffset Function Example

Here, the JavaScript get Timezone Offset returns the local time zone offset in minutes.

<!DOCTYPE html>
<html>
<head>
    <title> JavaScript Get Timezone Offset Function </title>
</head>
<body>
    <h1> JavaScript getTimezoneOffset Example </h1>
<script>
  var dt = Date("April 1, 2017 10:12:22.0716");  
  document.write("Date and Time : " + dt);
  document.write("Timezone Offset using getTimezoneOffset : " + dt.getTimezoneOffset());
</script>
</body>
</html>
JavaScript getTimezoneOffset 1