# isValidDateTimeInterval

Industry: Core

## Signature

```ts
isValidDateTimeInterval(start: string, end: string): boolean
```

Return true if `start` and `end` form a valid datetime interval — both parseable as ISO PlainDateTime strings and `start <= end`.

- Both inputs must be ISO 8601 datetime strings (e.g. `"2024-01-01T10:00:00"`).
- Equal `start === end` is valid.
- Invalid input, malformed strings, or leap-second strings return `false`.
- Each endpoint must satisfy `isValidDateTime`, so an annotation of any kind (a time zone, a calendar, an elective one) returns `false`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `start` | `string` | ISO 8601 datetime string (interval start) |
| `end` | `string` | ISO 8601 datetime string (interval end) |

## Returns

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

## Examples

```ts
import { isValidDateTimeInterval } from "@northguild/gmt/plain/interval";

isValidDateTimeInterval("2024-01-01T10:00:00", "2024-12-31T23:59:59") // true
```

## Source

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