@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
14 lines (13 loc) • 443 B
TypeScript
/**
* Return the current year from the Unix timestamp in UTC as a zero-padded string.
*
* - Uses Temporal.Now.instant() converted to UTC zoned date time.
* - Returns zero-padded string to 4 digits.
* - Returns "" on failure.
*
* @returns current year string (zero-padded to 4 digits) or "" on failure
*
* @example getUnixYear() // "2024"
* @example getUnixYear() // "" (on failure)
*/
export declare function getUnixYear(): string;