isBetweenUnix
Signature
Section titled “Signature”isBetweenUnix(value: number, start: number, end: number, options?: { epochUnit?: "seconds" | "milliseconds"; timeZone?: string; inclusiveStart?: boolean; inclusiveEnd?: boolean; }): booleanimport { isBetweenUnix } from "@northguild/gmt/unix/calculate";Return true when the Unix timestamp is between start and end (inclusive by default).
- Uses Temporal.Instant.compare for comparison.
- Returns false if start > end or inputs are invalid.
- Use options.inclusiveStart/inclusiveEnd to control boundaries.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
number |
Unix timestamp to check |
start |
number |
Unix timestamp for range start |
end |
number |
Unix timestamp for range end |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
epochUnit? |
"seconds" | "milliseconds" |
— |
timeZone? |
string |
— |
inclusiveStart? |
boolean |
— |
inclusiveEnd? |
boolean |
— |
Returns
Section titled “Returns”boolean indicating whether value is between start and end
Examples
Section titled “Examples”isBetweenUnix(1705000000000, 1704000000000, 1706000000000) // trueisBetweenUnix(1705000000, 1704000000, 1706000000, { epochUnit: "seconds" }) // trueisBetweenUnix(1703000000000, 1704000000000, 1706000000000) // false