Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to return the time-zone offset in minutes for the current locale?
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.
Example
You can try to run the following code to return the time-one offset in minutes −
<html>
<head>
<title>JavaScript getTimezoneOffset Method</title>
</head>
<body>
<script>
var dt = new Date();
var tz = dt.getTimezoneOffset();
document.write("getTimezoneOffset() : " + tz );
</script>
</body>
</html>Advertisements