FrontendDeveloper.in

JavaScript Track Detail

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

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