use ambient_authority::AmbientAuthority;
use iana_time_zone::get_timezone;
pub struct Timezone(());
#[derive(Debug)]
pub struct TimezoneError(String);
impl std::error::Error for TimezoneError {}
impl std::fmt::Display for TimezoneError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl Timezone {
#[inline]
pub const fn new(ambient_authority: AmbientAuthority) -> Self {
let _ = ambient_authority;
Self(())
}
#[inline]
pub fn timezone_name(&self) -> Result<String, TimezoneError> {
get_timezone().map_err(|e| TimezoneError(e.to_string()))
}
}