# std::chrono::choose

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

The scoped enumeration choose can be passed to certain member functions of std::chrono::time_zone and std::chrono::zoned_time to control how ambiguous or nonexistent local times should be resolved.

## Official Specification Summary (cppreference)

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

enum class choose {
    earliest,
    latest
}; // (since C++20)
```

The scoped enumeration `choose` can be passed to certain member functions of `std::chrono::time_zone` and `std::chrono::zoned_time` to control how ambiguous or nonexistent local times should be resolved. Passing `choose::earliest` causes the earlier time point to be returned, while passing `choose::latest` causes the later time point to be returned. (For nonexistent local times, these two time points are identical.)

If a `choose` is not passed and an ambiguous or nonexistent local time is encountered, a `std::chrono::ambiguous_local_time` or `std::chrono::nonexistent_local_time` exception (as applicable) will be thrown.

### See also

- [(constructor)](https://en.cppreference.com/w/cpp/chrono/zoned_time/zoned_time): constructs a `zoned_time` (public member function of `std::chrono::zoned_time<Duration,TimeZonePtr>`)
- [`to_sys`](https://en.cppreference.com/w/cpp/chrono/time_zone/to_sys): converts a `local_time` in this time zone to a `sys_time` (public member function of `std::chrono::time_zone`)

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