Skip to content

areDateTimesEqual

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

Return true if two PlainDateTime ISO strings represent the same instant of local date/time components.

  • Compares all date and time components.
  • Returns false if either input is invalid.
ParameterTypeDescription
value1stringfirst ISO PlainDateTime string
value2stringsecond ISO PlainDateTime string

boolean indicating whether both date-times are equal component-wise

import { areDateTimesEqual } from "@northguild/gmt/plain/compare";
areDateTimesEqual("2024-02-29T12:34:56", "2024-02-29T12:34:56") // true
output 

plain/compare/areDateTimesEqual.ts