Skip to content

parseMillisecondFromUtc

parseMillisecondFromUtc(value: string): string
import { parseMillisecondFromUtc } from "@northguild/gmt/utc/parse";

Return the millisecond (0-999) from a UTC datetime string.

  • Returns zero-padded string for millisecond.
  • Returns “” for invalid input.
Parameter Type Description
value string ISO UTC datetime string (e.g., “2024-03-17T14:30:45.123Z”)

Millisecond (000-999) or “” on invalid input

parseMillisecondFromUtc("2024-03-17T14:30:45.123Z") // "123"
parseMillisecondFromUtc("invalid") // ""

utc/parse/parseMillisecondFromUtc.ts