parseTimeFromUnix
Signature
Section titled “Signature”parseTimeFromUnix(value: number, options?: { epochUnit?: UnixUnit; timeZone?: string; }): stringimport { parseTimeFromUnix } from "@northguild/gmt/unix/parse";Extract the time portion from a unix epoch value.
- Converts to ZonedDateTime then extracts the PlainTime.
- Uses system timezone if not specified.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
number |
unix epoch in milliseconds or seconds (number) |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
epochUnit? |
UnixUnit |
— |
timeZone? |
string |
— |
Returns
Section titled “Returns”ISO time string (e.g., “14:30:45”) or “” on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”parseTimeFromUnix(1700000000000) // "04:13:20"parseTimeFromUnix(1700000000, { epochUnit: "seconds" }) // "04:13:20"parseTimeFromUnix(-86400, { epochUnit: "seconds" }) // "00:00:00"