Skip to the content

Kuni国

Look up countries, codes, names and subdivisions, load country data on demand and mount a native country card.

Kuni (国) is Japanese for a country. About the name

Contents

Reference · /zones

subdivisionTimeZonefunction

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 it

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

Definition

function subdivisionTimeZone(code: string): ZoneAnswer | null

Parameters

NameTypeDescription
codestring

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

Returns

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.

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kuni 1.19.0.