Date.prototype.getTimezoneOffset() returns the difference, in minutes, between this date in UTC and in the local timezone of the host (MDN). It is read-only and does not change the Date.
Remember
date.getTimezoneOffset()
→ minutes: UTC − local
→ NaN if the Date is invalid
Examples (MDN-style):
UTC−8 → 480
UTC → 0
UTC+3 → -180
UTC+5:30 (India) → -330
Not the GMT offset written in a date string —
always the host local offset for that instant.
Syntax
Call date.getTimezoneOffset. Start with this line.
JavaScript
date.getTimezoneOffset()
Call
What it does
date.getTimezoneOffset()
Primary signature.
date.getTimezoneOffset(...)
Call with the arguments your case needs.
Built into JavaScript. Call getTimezoneOffset(...) on a Date instance — no import required.
Library declarations
JavaScript
date.getTimezoneOffset()
Parameters
This method has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Minutes: UTC − local
JavaScript Examples
Example 1 — Read the Local Offset
MDN: different GMT strings still share the same host offset.
JavaScript
const date1 = new Date("August 19, 1975 23:15:30 GMT+07:00");
const date2 = new Date("August 19, 1975 23:15:30 GMT-02:00");
console.log(date1.getTimezoneOffset()); // your local offset (e.g. -330)
console.log(date1.getTimezoneOffset() === date2.getTimezoneOffset()); // true
In DST regions, winter and summer dates may return different minutes (MDN).
JavaScript
const winter = new Date("2022-02-01").getTimezoneOffset();
const summer = new Date("2022-08-01").getTimezoneOffset();
console.log(winter); // e.g. 300 in New York (UTC−5)
console.log(summer); // e.g. 240 in New York (UTC−4)
console.log(winter === summer); // true if no DST; false if DST applies
(winter offset — depends on your timezone)
(summer offset — depends on your timezone)
(true or false)
How It Works
Two dates. February and August sample different seasons.
DST zones. Offsets can shrink in summer (e.g. 300 → 240 in New York).
No-DST zones. Both calls match → true (e.g. India year-round).
Rule. Always call getTimezoneOffset() on the specific date you care about.
Compatibility
Browser & Runtime Support
Date.prototype.getTimezoneOffset() is part of the language from early ECMAScript and is Baseline Widely available (MDN).
✓ Baseline · Widely available
Date.prototype.getTimezoneOffset()
Supported in every modern browser and Node.js. No polyfill needed for ordinary web apps.
99%Modern browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
Date.getTimezoneOffset()Excellent
Bottom line: Safe everywhere. Focus on the inverted sign, DST, and invalid-Date checks rather than feature detection.
Frequently Asked Questions
The difference in minutes between this date in UTC and in the local timezone (host system). Positive means local time is behind UTC; negative means local is ahead of UTC. Invalid Dates return NaN.
It returns UTC − local in minutes. UTC+5:30 (India) yields −330. UTC−8 yields +480. It is not the same sign as a UTC± label.
No. MDN: two Dates built with different GMT offsets still return the same getTimezoneOffset() — the host local offset for that instant, not the offset written in the string.
Yes. In DST regions the minutes can differ for summer vs winter dates. Only the Date’s instant matters, not when you run the code.
NaN. Validate with Number.isNaN(date.getTime()) first.
getTimezoneOffset() only returns minutes. Prefer Intl.DateTimeFormat().resolvedOptions().timeZone for an IANA zone name.