@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
19 lines (18 loc) • 741 B
TypeScript
import type { UnixUnit } from "../validate/index.js";
/**
* Return the nanosecond (0-999) from a unix epoch value.
*
* - Delegates to {@link parseUnitFromUnix} with unit "nanosecond".
* - Returns "" for invalid input.
*
* @param value unix epoch in milliseconds or seconds (number or string)
* @param options optional: epochUnit ("seconds" | "milliseconds"), timeZone (IANA)
* @returns Nanosecond (000-999) or "" on invalid input
*
* @example parseNanosecondFromUnix(1700000000000) // "000000000"
* @example parseNanosecondFromUnix(-86400, { epochUnit: "seconds" }) // "000000000"
*/
export declare function parseNanosecondFromUnix(value: number | string, options?: {
epochUnit?: UnixUnit;
timeZone?: string;
}): string;