OXYGENHUB
# 170bb436e1d5 oxygen / vendor / iana-time-zone / src / tz_windows.rs
587 B · Rust · last changed Strata: the cloud stores send through ureq, so every release target links 1 month ago source blame history raw
1
#[path = "windows_bindings.rs"]
2
#[allow(missing_debug_implementations, clippy::undocumented_unsafe_blocks)]
3
mod windows_bindings;
4
use windows_bindings::Windows::Globalization::Calendar;
5
6
impl From<windows_core::Error> for crate::GetTimezoneError {
7
    fn from(orig: windows_core::Error) -> Self {
8
        crate::GetTimezoneError::IoError(std::io::Error::new(std::io::ErrorKind::Other, orig))
9
    }
10
}
11
12
pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> {
13
    let cal = Calendar::new()?;
14
    let tz_hstring = cal.GetTimeZone()?;
15
    Ok(tz_hstring.to_string())
16
}