Standard built-ins

Date.prototype.getTimezoneOffset()

Try the free JavaScript compiler

Return minutes of UTC minus local time for the instant in the host time zone; may vary across dates. Negative indicates local time ahead of UTC. Example tests type only.

Formal Syntax & Structure

javascript syntaxjavascript
date.getTimezoneOffset()

Return Value

Number

Offset in minutes or NaN.

Working Example

Example Snippetjavascript
console.log(typeof new Date(0).getTimezoneOffset());
JavaScript Reference