# isBetweenTime

Industry: Core

## Signature

```ts
isBetweenTime(time: string, start: string, end: string, options?: { inclusiveStart?: boolean; inclusiveEnd?: boolean; }): boolean
```

Return true when `time` is between `start` and `end` (inclusive by default).

- Uses Temporal.PlainTime.compare to compare times.
- Returns false if start &gt; end (invalid range).
- Returns false if any input is invalid.
- Note: PlainTime comparison does not account for day overflow.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `time` | `string` | ISO PlainTime string to check |
| `start` | `string` | ISO PlainTime string for the start of the range |
| `end` | `string` | ISO PlainTime string for the end of the range |

## Options

**options**

Whether each end of the range counts as inside it

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `inclusiveStart?` | `boolean` | `true` | Whether `time` equal to `start` counts as inside the range. `false` requires it to be after `start`. |
| `inclusiveEnd?` | `boolean` | `true` | Whether `time` equal to `end` counts as inside the range. `false` requires it to be before `end`. |

## Returns

boolean indicating whether time is between start and end

## Examples

```ts
import { isBetweenTime } from "@northguild/gmt/plain/compare";

isBetweenTime("12:34:56", "12:00:00", "13:00:00") // true
```

## Source

[plain/compare/isBetweenTime.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/compare/isBetweenTime.ts)
