Skip to content

areUtcEqual

areUtcEqual(value1: string, value2: string): boolean

Return whether value1 and value2 represent the same instant.

  • Uses Temporal.Instant.compare for equality check.
  • Returns false if either input is invalid.
ParameterTypeDescription
value1stringfirst UTC datetime string
value2stringsecond UTC datetime string

true if value1 equals value2, otherwise false

import { areUtcEqual } from "@northguild/gmt/utc/compare";
areUtcEqual("2024-03-17T14:30:45Z", "2024-03-17T14:30:45Z") // true
output 

utc/compare/areUtcEqual.ts