@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
14 lines (13 loc) • 430 B
TypeScript
/**
* Return the year for a given ISO 8601 datetime string.
*
* - Returns the year as a string (e.g., "2024").
* - Returns "" for invalid input.
*
* @param value ISO datetime string
* @returns Year (YYYY) or "" on invalid input
*
* @example parseYearFromDateTime("2024-03-15T12:30:00") // "2024"
* @example parseYearFromDateTime("invalid") // ""
*/
export declare function parseYearFromDateTime(value: string): string;