Core accepts full IANA identifiers, fixed UTC offsets, and 'UTC'. Importing this plugin extends every zone parameter across the library to accept human city names, common abbreviations, and custom aliases.
zones.js
import '@native-dates/plugins/zones';import { date, datetime, today } from 'native-dates';const standup = datetime('2026-11-16T09:30', 'PT');standup.zone; // 'America/Los_Angeles'standup.in('Berlin').hour; // 18date('2026-11-16').at('9:00am', 'Beijing').zone; // 'Asia/Shanghai'today('JST').toString(); // current date in Asia/Tokyo
Every spelling normalizes to its canonical IANA identifier on the resulting instance. Comparing zones or serializing values stays consistent regardless of how the zone was typed.
City names
Any city in the runtime’s time zone database resolves regardless of letter case, accents, spaces, or underscores. Major cities whose zone IANA files under another name also work out of the box, including local-script spellings.
const moment = datetime('2026-11-03T17:30Z');moment.in('los angeles').zone; // 'America/Los_Angeles'moment.in('Mumbai').zone; // 'Asia/Kolkata'moment.in('Rio de Janeiro').zone; // 'America/Sao_Paulo'moment.in('東京').zone; // 'Asia/Tokyo'moment.in('Москва').zone; // 'Europe/Moscow'
Built-in city aliases cover major hubs such as NYC, San Francisco, Beijing, Mumbai, Munich, and Osaka. Unrecognized names still throw an unknownZone error rather than falling back to the local system clock.
Abbreviations that follow the locale
Some abbreviations mean different zones in different countries. When a name is shared, the plugin checks the active locale’s region first and falls back to the primary reading elsewhere.
Indochina, Western Indonesia, and Philippine Time.
JST, KST
'Asia/Tokyo', 'Asia/Seoul'
Japan and Korea Standard Time.
SGT, HKT
'Asia/Singapore', 'Asia/Hong_Kong'
Singapore and Hong Kong Time.
AET, AEST, AEDT
'Australia/Sydney'
Australian Eastern Time.
ACT, AWT
'Australia/Adelaide', 'Australia/Perth'
Australian Central and Western Time (ACT follows locale).
NZT, NZST, NZDT
'Pacific/Auckland'
New Zealand Time.
Abbreviations observe daylight saving time
In raw IANA data, bare EST is a fixed five-hour offset that never springs forward in March. This plugin maps Pacific and Eastern abbreviations to 'America/Los_Angeles' and 'America/New_York' so daylight saving math stays accurate. Pass a numeric offset like '-08:00' when you want a fixed offset year-round.
Custom aliases
Register shorthand names for offices, teams, or fixed abbreviation overrides once at startup with configure(). Custom aliases take precedence over locale-based resolution.
configure()
configure({ zoneAliases }): Settings
Adds or removes custom zone names in the global settings table. Alias keys match without case or accent sensitivity, and targets can be full IANA names, cities, or abbreviations. Set a key to null to delete one alias, or pass zoneAliases: null to clear them all.
Parameters
zoneAliasesRecord<string, Zone | null> | null
Map of custom names to valid zones or null, or null to clear every custom alias.
Returns
Settings
Snapshot of the active configuration with canonicalized alias targets.
The plugin also exports its mutable timezones lookup map when inspecting or pinning base abbreviations directly at boot. Setting an entry like timezones.IST = 'Asia/Jerusalem' overrides locale-based resolution for every locale:
import { timezones } from '@native-dates/plugins/zones';timezones.JST; // 'Asia/Tokyo'