parseDayOfWeekFromUnix
Signature
Section titled “Signature”parseDayOfWeekFromUnix(value: string | number, options?: { epochUnit?: UnixUnit; timeZone?: string; }): numberimport { parseDayOfWeekFromUnix } from "@northguild/gmt/unix/parse";Return the day of week (1-7) from a unix epoch value.
- Monday=1 through Sunday=7.
- Returns null 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”Day of week (1-7) or null on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”parseDayOfWeekFromUnix(1704067200000) // 1parseDayOfWeekFromUnix(-86400, { epochUnit: "seconds" }) // 2