@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
14 lines (13 loc) • 482 B
TypeScript
/**
* Return the current year for the specified IANA timeZone.
*
* - Uses Temporal.Now.zonedDateTimeISO to get the current time.
* - Validation is performed on the timezone.
*
* @param ianaTimezone IANA timeZone identifier
* @returns current year string (zero-padded to 4 digits) or "" on invalid input
*
* @example getZonedYear("America/New_York") // "2024"
* @example getZonedYear("invalid") // ""
*/
export declare function getZonedYear(ianaTimezone: string): string;