English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
inUse getTimezoneOffset()The method returns the time difference in minutes from the current region (host system settings) to UTC.
World Standard Time (UTC) is the standard time set for world time.
The time zone offset is the number of minutes, Greenwich Mean Time (GMT) relative to local time.
For example, if your time zone is GMT + 2If it is-120.
Daylight Saving Time can prevent this value from remaining constant.
date.getTimezoneOffset()
var d = new Date(); d.getTimezoneOffset();Test See‹/›
All browsers fully support the getTimezoneOffset() method:
Method | |||||
getTimezoneOffset() | Yes | Yes | Yes | Yes | Yes |
Return Value: | A number representing the time difference between UTC and local time, in minutes |
---|---|
JavaScript Version: | ECMAScript 1 |