forked from Rust-related/RustPython
function to retrieve tz info on windows
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
committed by
Jeong, YunWon
parent
517ffed401
commit
9856d94f2d
@@ -116,6 +116,7 @@ features = [
|
||||
"Win32_Foundation",
|
||||
"Win32_System_LibraryLoader",
|
||||
"Win32_System_Threading",
|
||||
"Win32_System_Time",
|
||||
"Win32_UI_Shell",
|
||||
]
|
||||
|
||||
|
||||
@@ -152,6 +152,17 @@ mod decl {
|
||||
Ok(get_perf_time(vm)?.as_nanos())
|
||||
}
|
||||
|
||||
#[cfg(target_env = "msvc")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn get_tz_info() -> Time::TIME_ZONE_INFORMATION {
|
||||
let mut info = Time::TIME_ZONE_INFORMATION::default();
|
||||
let info_ptr = &mut info as *mut Time::TIME_ZONE_INFORMATION;
|
||||
let _ = unsafe {
|
||||
Time::GetTimeZoneInformation(info_ptr)
|
||||
};
|
||||
info
|
||||
}
|
||||
|
||||
// #[pyfunction]
|
||||
// fn tzset() {
|
||||
// unsafe { super::_tzset() };
|
||||
|
||||
Reference in New Issue
Block a user