| 2cd40ea1 Andy McCall ↶ |
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 |
} |