# intervalEngulfsUtc

Industry: Core

## Signature

```ts
intervalEngulfsUtc(aStart: string, aEnd: string, bStart: string, bEnd: string): boolean
```

Return true when the half-open interval B `[bStart, bEnd)` lies within the half-open interval A `[aStart, aEnd)` — every instant of B is also in A.

- Half-open: an interval holds every `t` with `start <= t < end`. B may start at A's start and end at A's end, because neither end is part of either interval.
- B must also overlap A, so an empty B (`bStart === bEnd`) counts only strictly inside A, never at an edge (CORE-6's `clampInterval` clamps it away there).
- Equivalent to 4-argument `intervalContainsUtc(aStart, aEnd, bStart, bEnd)`.
- Uses `Temporal.Instant.compare` for comparison.
- Returns `false` if either interval is invalid (`start > end`).
- Returns `false` on invalid input (wrong type, non-`Z` strings, malformed strings, leap seconds).

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `aStart` | `string` | ISO 8601 UTC datetime string for the outer interval start |
| `aEnd` | `string` | ISO 8601 UTC datetime string for the outer interval end (excluded) |
| `bStart` | `string` | ISO 8601 UTC datetime string for the inner interval start |
| `bEnd` | `string` | ISO 8601 UTC datetime string for the inner interval end (excluded) |

## Returns

true if B lies within A, or false on invalid input

## Examples

```ts
import { intervalEngulfsUtc } from "@northguild/gmt/utc/interval";

intervalEngulfsUtc("2024-01-01T09:00:00Z", "2024-01-01T17:00:00Z", "2024-01-01T12:00:00Z", "2024-01-01T13:00:00Z") // true
```

## Source

[utc/interval/intervalEngulfsUtc.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/utc/interval/intervalEngulfsUtc.ts)
