parseSecondFromUnix
Signature
Section titled “Signature”parseSecondFromUnix(value: string | number, options?: { epochUnit?: UnixUnit; timeZone?: string; }): stringimport { parseSecondFromUnix } from "@northguild/gmt/unix/parse";Return the second (0-59) from a unix epoch value.
- Delegates to {@link parseUnitFromUnix} with unit “second”.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string | number |
unix epoch in milliseconds or seconds (number or string) |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
epochUnit? |
UnixUnit |
— |
timeZone? |
string |
— |
Returns
Section titled “Returns”Second (00-59) or “” on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”parseSecondFromUnix(1700000000000) // "26"parseSecondFromUnix(-86400, { epochUnit: "seconds" }) // "00"