Skip to content

isBetweenUtc

  • The core functions, which every industry uses.
isBetweenUtc(value: string, start: string, end: string, options?: { inclusiveStart?: boolean; inclusiveEnd?: boolean; }): boolean

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

  • Uses Temporal.Instant.compare for comparison.
  • Returns false if start > end or inputs are invalid.
ParameterTypeDescription
valuestringISO UTC datetime string to check
startstringISO UTC datetime string for range start
endstringISO UTC datetime string for range end

options

Whether each boundary counts as inside the range

OptionTypeDefaultDescription
inclusiveStart?booleantrueWhether value equal to start counts as inside the range. false requires it to be after start.
inclusiveEnd?booleantrueWhether value equal to end counts as inside the range. false requires it to be before end.

boolean indicating whether value is between start and end

import { isBetweenUtc } from "@northguild/gmt/utc/calculate";
isBetweenUtc("2024-03-15T12:00:00Z", "2024-03-10T12:00:00Z", "2024-03-20T12:00:00Z") // true
output 

utc/calculate/isBetweenUtc.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.