Intl.Locale.prototype.timeZones

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

ブラウザーの互換性

BCD tables only load in the browser

関連情報