本文へ移動

Kuni国

国、コード、名前、行政区画を調べ、必要なときに国のデータを読み込み、標準の国のカードを表示できます。

「国(くに)」は、国を表す日本語です。 名前について(英語)

目次

リファレンス · /zones

subdivisionTimeZone関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The IANA time zone of a first-level subdivision, by its ISO 3166-2 code: what a map of a country's regions shows.

In a country with one zone, that zone (estimated: false). In a country with several, the zone Wikidata gives the subdivision where it gives one of the country's zones alone (estimated: false); where it gives several (Indiana, Idaho) or none, the one whose principal city in IANA's zone.tab is nearest the subdivision's capital (estimated: true); and for the few kuni has no point for and Wikidata names no zone of (Beijing, Catalonia), the zone of the country's capital (estimated: true).

インポート

import { subdivisionTimeZone } from "@johnmorrisdotca/kuni/zones";

定義

function subdivisionTimeZone(code: string): ZoneAnswer | null

引数

名前型説明
codestring

An ISO 3166-2 code, "US-WA" or "us-wa".

戻り値

ZoneAnswer | null

The zone and whether it was estimated; null for a code kuni does not list as a first-level subdivision, or one in a country with no zone.

例

import { subdivisionTimeZone } from "@johnmorrisdotca/kuni/zones";

console.log(subdivisionTimeZone("US-WA")); // { zone: "America/Los_Angeles", estimated: false }
console.log(subdivisionTimeZone("JP-13")?.zone); // "Asia/Tokyo"
{ zone: 'America/Los_Angeles', estimated: false }
Asia/Tokyo

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kuni 1.19.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。