//! IANA timezone helpers backed by jiff's bundled tzdb, so results do not depend on the host. use jiff::{Timestamp, tz::TimeZone}; use crate::error::{Error, Result}; /// Resolves an IANA name, falling back to UTC for anything unknown. fn zone_or_utc(tz: &str) -> TimeZone { TimeZone::get(tz).unwrap_or(TimeZone::UTC) } /// Accepts only names known to the bundled tzdb, such as "Europe/Istanbul" or "UTC". pub fn validate_timezone(name: &str) -> Result<()> { TimeZone::get(name) .map(|_| ()) .map_err(|_| Error::Invalid(format!("timezone {name:?}"))) } /// Every known IANA name, sorted and without duplicates, for the timezone `