Skip to content

parseMillisecondFromUnix

parseMillisecondFromUnix(value: string | number, options?: { epochUnit?: UnixUnit; timeZone?: string; }): string
import { parseMillisecondFromUnix } from "@northguild/gmt/unix/parse";

Return the millisecond (0-999) from a unix epoch value.

  • Delegates to {@link parseUnitFromUnix} with unit “millisecond”.
  • Returns “” for invalid input.
Parameter Type Description
value string | number unix epoch in milliseconds or seconds (number or string)

options

Option Type Default
epochUnit? UnixUnit
timeZone? string

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

parseMillisecondFromUnix(1700000000000) // "000"
parseMillisecondFromUnix(-86400, { epochUnit: "seconds" }) // "000"

unix/parse/parseMillisecondFromUnix.ts