Skip to content

parseMicrosecondFromUnix

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

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

  • Delegates to {@link parseUnitFromUnix} with unit “microsecond”.
  • 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

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

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

unix/parse/parseMicrosecondFromUnix.ts