# areZonedEqual

Industry: Core

## Signature

```ts
areZonedEqual(value1: string, value2: string): boolean
```

Compare two zoned datetime strings the way Temporal's `ZonedDateTime.prototype.equals` does.

- Inputs must be valid ISO 8601 zoned datetime strings.
- Returns `true` when both values are the same instant (equal epoch nanoseconds), are in the same time zone and use the same calendar; otherwise `false`.
- The offset in the string is part of the instant, so the two passes of a repeated wall clock (`02:30+02:00` and `02:30+01:00` on Berlin's 2024-10-27 fall-back) are different values.
- Two identifiers of one time zone are one time zone (Temporal TimeZoneEquals): `UTC`, `Etc/UTC` and `GMT`, and identifiers that differ only in letter case, on every host. An IANA link such as `Europe/Kiev` and `Europe/Kyiv` is one zone where the host resolves it; Safari 27 without `Temporal` keeps the two names as written. An offset zone (`[+05:30]`) equals only the same offset zone, never a named zone.
- The calendar is compared too, but only `iso8601` reaches it: a non-ISO calendar annotation is invalid input.
- The same instant written in two different zones is not equal; compare instants across zones with `isBeforeZoned` and `isAfterZoned`.
- Invalid inputs return `false`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value1` | `string` | first zoned datetime string |
| `value2` | `string` | second zoned datetime string |

## Returns

`true` when the two zoned datetimes are equal; `false` when they differ or either input is invalid

## Examples

```ts
import { areZonedEqual } from "@northguild/gmt/zoned/compare";

areZonedEqual("2024-02-29T12:34:56.789+00:00[UTC]", "2024-02-29T12:34:56.789+00:00[UTC]") // true
```

## Source

[zoned/compare/areZonedEqual.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/zoned/compare/areZonedEqual.ts)
