Javascript examples for Date:getTimezoneOffset
The getTimezoneOffset() method returns the time difference between UTC time and local time, in minutes.
For example, If your time zone is GMT+2, -120 will be returned.
UTC time is the same as GMT time.
None
A Number, representing the time difference between UTC and Local Time, in minutes
The following code shows how to return the timezone difference between UTC and Local Time:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w .ja va 2 s . c om var d = new Date(); var n = d.getTimezoneOffset(); document.getElementById("demo").innerHTML = n; } </script> </body> </html>