UNPKG

iana-db-timezones

Version:

Auto-generated IANA timezone data with rich metadata, no dependencies, full TypeScript support, and Node/browser compatibility.

43 lines (42 loc) 1.53 kB
import { type TimezoneCode } from './timezones.js'; export type { TimezoneCode } from './timezones.js'; import type { Timezone } from './src/types'; export * from './src/types.js'; declare const _default: { zones: Record<TimezoneCode, Timezone>; map: Map<TimezoneCode, Timezone>; /** * Returns zone by timezone tzCode * @param {TimezoneCode} tzCode The tz tzCode of the timezone (e.g., 'Europe/Sofia') * @example * ```js * getZone('Europe/Sofia') * // => { * // countryCodes: ['BG'], * // utc: '+03:00', * // geographicArea: 'Europe', * // location: 'Sofia', * // locationLabel: 'Sofia', * // tzCode: 'Europe/Sofia', * // type: 'Canonical' * // } * ``` */ getZone: (tzCode: TimezoneCode) => Timezone | null; /** * Returns the current offset for a timezone * @param {TimezoneCode} tzCode The tzCode of the timezone (e.g., 'Europe/Sofia') * @example getZoneUTC('Europe/Sofia') //=> '+03:00' */ getZoneUTC: (tzCode: TimezoneCode) => string | null; /** * Returns the current ISO date-time adjusted to the timezone offset. * * The format is `YYYY-MM-DDTHH:mm:ss.sss+HH:MM` or `YYYY-MM-DDTHH:mm:ss.sss-HH:MM` * * @param {TimezoneCode} tzCode The tzCode of the timezone (e.g., 'Europe/Sofia') * @example getZoneISODate('Europe/Sofia') //=> '2025-05-12T08:25:49.322+03:00' */ getZoneISODate: (tzCode: TimezoneCode) => string | null; }; export default _default;