Tutorial Gateway

  • C Language
  • Java
  • R
  • SQL
  • MySQL
  • Python
  • BI Tools
    • Informatica
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • QlikView
  • Js

JavaScript getTimezoneOffset

by suresh

JavaScript getTimezoneOffset function is one of the Date Function, which returns the time zone offset of a given date in minutes.

In this article, we will show you, How to use the Get Timezone Offset in JavaScript Programming with an example.

JavaScript getTimezoneOffset Syntax

The basic syntax for this getTimezoneOffset function is:

 Date.getTimezoneOffset()

JavaScript getTimezoneOffset Function Example

The following example helps you understand the JavaScript get Timezone Offset Function. Here, getTimezoneOffset 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>

OUTPUT

JavaScript getTimezoneOffset 1

Placed Under: JavaScript

Stay in Touch!

Sign Up to receive Email updates on Latest Tutorials

  • C Programs
  • Java Programs
  • SQL FAQ’s
  • Python Programs
  • SSIS
  • Tableau
  • JavaScript

Copyright © 2019 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy