@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
15 lines • 568 B
TypeScript
/**
* Return the nanosecond (0-999) for a given ISO 8601 time string.
*
* - Returns zero-padded string for nanosecond.
* - Returns "" for invalid input.
*
* @param value ISO time string
* @returns Nanosecond (000-999) or "" on invalid input
*
* @example parseNanosecondFromTime("12:30:45.123") // "000"
* @example parseNanosecondFromTime("12:30:45.123456789") // "789"
* @example parseNanosecondFromTime("12:30:45.000") // "000"
* @example parseNanosecondFromTime("invalid") // ""
*/
export declare function parseNanosecondFromTime(value: string): string;