Skip to content

isPastCutoff

  • Legs, dwell, cut-offs and punctuality, shared by road, rail, sea and air.
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.
ParameterTypeDescription
nowstringISO 8601 instant string of the moment asked about
cutoffstringISO 8601 zoned datetime string of the cut-off, exactly as cutoffAt returns it

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

import { isPastCutoff } from "@northguild/gmt/transport/compare";
isPastCutoff("2024-06-12T16:00:00Z", "2024-06-12T17:00:00+02:00[Europe/Amsterdam]") // true
output 

transport/compare/isPastCutoff.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.