Skip to content

isBeforeZoned

  • The core functions, which every industry uses.
isBeforeZoned(value1: string, value2: string): boolean

Return whether value1 represents an instant strictly before value2.

  • Both inputs must be valid zoned ISO 8601 datetime strings.
  • Comparison is performed using Temporal.Instant (same instant semantics), so differing timeZone representations but the same instant will compare as equal.
  • Invalid inputs return false.
ParameterTypeDescription
value1stringfirst zoned datetime string
value2stringsecond zoned datetime string

true if value1 is before value2, otherwise false

import { isBeforeZoned } from "@northguild/gmt/zoned/compare";
isBeforeZoned("2024-03-17T14:30:45+02:00[Africa/Johannesburg]", "2024-03-17T15:30:45+02:00[Africa/Johannesburg]") // true
output 

zoned/compare/isBeforeZoned.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.