InterviewHubPRO
Section Overview
Q298

Question 298 of 521

Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

57%
JavaScript Internals (521 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

How do you get the timezone offset of a date object

You can use the getTimezoneOffset method of the date object. This method returns the time zone difference, in minutes, from current locale (host system settings) to UTC

javascript
  var offset = new Date().getTimezoneOffset();
  console.log(offset); // -480