Intl.Locale.prototype.timeZones
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Intl.Locale.prototype.timeZones
プロパティはアクセサープロパティで、選択した Locale
で対応しているタイムゾーンの配列を返します。
解説
関連付けられた Locale
で対応しているタイムゾーンを配列で返します。返されるタイムゾーンは IANA タイムゾーン を表します。
メモ:
Unicode 言語識別子が Unicode 地域サブタグシーケンスの -
を含んでいない場合、返される値は undefined
です。
例
対応しているタイムゾーンの取得
指定された Locale
で対応しているタイムゾーンをリストアップします。
js
let arEG = new Intl.Locale("ar-EG");
console.log(arEG.timeZones); // logs ["Africa/Cairo"]
js
let jaJP = new Intl.Locale("ja-JP");
console.log(jaJP.timeZones); // logs ["Asia/Tokyo"]
js
let ar = new Intl.Locale("ar");
console.log(ar.timeZones); // logs undefined
仕様書
Specification |
---|
Intl Locale Info Proposal # sec-Intl.Locale.prototype.getTimeZones |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getTimeZones |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
- Uses a non-standard name.
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.