# isValidUnixInterval

Industry: Core

## Signature

```ts
isValidUnixInterval(start: string | number, end: string | number): boolean
```

Return true if `start` and `end` form a valid Unix interval — both safe-integer epochs and `start <= end`.

- Each input must be a safe integer (`Number.isSafeInteger`) or a string of optionally negative ASCII digits naming one — the epoch grammar every `unix/` function shares.
- Fractional values, `NaN`, `±Infinity` and anything beyond ±(2^53 − 1) return `false`.
- Strings with whitespace, `+`, a decimal point, an exponent or hex digits return `false`, and an empty string is not epoch 0.
- Equal `start === end` is valid.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `start` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — interval start |
| `end` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — interval end |

## Returns

true if start and end form a valid Unix interval, or false on invalid input

## Examples

```ts
import { isValidUnixInterval } from "@northguild/gmt/unix/interval";

isValidUnixInterval(0, 1700000000) // true
```

## Source

[unix/interval/validate/isValidUnixInterval.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/unix/interval/validate/isValidUnixInterval.ts)
