Date.getTimezoneOffset

概要

UTCと現在のロケール時間との差を分単位で返します。

Method of Date
実装されたバージョン JavaScript 1.0
ECMAScript エディション ECMAScript 1st Edition

構文

dateObj.getTimezoneOffset() 

引数

無し

説明

The time-zone offset is the difference, in minutes, between UTC and local time. Note that this means that the offset is positive if the local timezone is behind UTC and negative if it is ahead.  For example, if your time zone is UTC+10 (Australian Eastern Standard Time), -600 will be returned. Daylight savings time prevents this value from being a constant even for a given locale

Example: Using getTimezoneOffset

var x = new Date();
var currentTimeZoneOffsetInHours = x.getTimezoneOffset() / 60;

Document Tags and Contributors

Contributors to this page: ethertank, hateka
最終更新者: ethertank,