@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
14 lines (13 loc) • 539 B
TypeScript
/**
* Returns the zoned datetime string rounded/truncated to second precision.
*
* - Removes millisecond precision.
* - Returns "" for invalid input.
*
* @param value ISO 8601 zoned datetime string
* @returns Zoned datetime string without milliseconds or "" for invalid
*
* @example chopZonedMilliseconds("2024-02-29T14:30:45.123-05:00[America/New_York]") // "2024-02-29T14:30:45-05:00[America/New_York]"
* @example chopZonedMilliseconds("invalid") // ""
*/
export declare function chopZonedMilliseconds(value: string): string;