areUtcEqual
Signature
Section titled “Signature”areUtcEqual(value1: string, value2: string): booleanimport { areUtcEqual } from "@northguild/gmt/utc/compare";Return whether value1 and value2 represent the same instant.
- Uses Temporal.Instant.compare for equality check.
- Returns false if either input is invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value1 |
string |
first UTC datetime string |
value2 |
string |
second UTC datetime string |
Returns
Section titled “Returns”true if value1 equals value2, otherwise false
Examples
Section titled “Examples”areUtcEqual("2024-03-17T14:30:45Z", "2024-03-17T14:30:45Z") // trueareUtcEqual("2024-03-17T14:30:45Z", "2024-03-17T14:30:44Z") // falseareUtcEqual("2024-03-17T14:30:45Z", "invalid") // false