# isPastCutoff

Industry: Transport

## Signature

```ts
isPastCutoff(now: string, cutoff: string): boolean
```

Report whether a cut-off has passed.

- The window to meet a cut-off is half-open, `[…, cutoff)`: at the cut-off instant itself it has closed, so `now` equal to `cutoff` is past. This matches the half-open rule GMT's intervals follow, and `timeToCutoff`, which is `PT0S` there.
- `now` is an exact instant (`Z`/offset) with no annotation of any kind. `cutoff` is the zoned string `cutoffAt` returns, `<date>T<time>±HH:MM[Zone]`: an offset (or `Z`), then one time zone bracket that agrees with it (the critical `[!Zone]` too), and nothing after. A bare instant, an offset-less wall time, an offset bracket (`[+02:00]`) or any other annotation is invalid. They are compared as instants, so the two passes of a repeated hour are told apart by their offsets.
- `now` is the caller's: GMT does not read the clock here, so the answer is reproducible.
- Returns `false` on invalid input, including `cutoffAt`'s `""` sentinel — which reads as "not past". Check the cut-off is not `""` before trusting a `false`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `now` | `string` | ISO 8601 instant string of the moment asked about |
| `cutoff` | `string` | ISO 8601 zoned datetime string of the cut-off, exactly as `cutoffAt` returns it |

## Returns

true when now is at or after the cut-off, false otherwise or on invalid input

## Examples

```ts
import { isPastCutoff } from "@northguild/gmt/transport/compare";

isPastCutoff("2024-06-12T16:00:00Z", "2024-06-12T17:00:00+02:00[Europe/Amsterdam]") // true
```

## Source

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