getTimezoneOffset (JavaScript)

Gets the difference in minutes between UTC and local time.

Defined in

Date (Standard - JavaScript)

Syntax

getTimezoneOffset() : int
Return value Description
int The time offset in minutes.

Examples

This computed label calculates the time offset in hours.
var date = new Date();
(date.getTimezoneOffset()/60).toString() + " hours"