# std::chrono::operator==(std::chrono::zoned_time)

> C++ Atlas: `cppatlas.com/w/cpp/chrono/zoned_time/operator_cmp` | Source: https://en.cppreference.com/w/cpp/chrono/zoned_time/operator_cmp | Domain: Date and time utilities | Standards: C++20

Compares the two zoned_time values x and y. Two zoned_time objects compare equal if their time points and time zone pointers both compare equal according to operator==.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <chrono>

template< class Duration1, class Duration2, class TimeZonePtr >
bool operator==( const std::chrono::zoned_time<Duration1, TimeZonePtr>& x,
                 const std::chrono::zoned_time<Duration2, TimeZonePtr>& y ); // (since C++20)
```

Compares the two `zoned_time` values `x` and `y`. Two `zoned_time` objects compare equal if their time points and time zone pointers both compare equal according to `operator==`.

The `!=` operator is synthesized from `operator==`.

### Return value

`x.get_time_zone() == y.get_time_zone() && x.get_sys_time() == y.get_sys_time()`, except that the comparisons are performed on the nonstatic data members of `x` and `y` directly and no copying is performed.

---
Attribution: content from https://en.cppreference.com/w/cpp/chrono/zoned_time/operator_cmp (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.