Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
function to retrieve tz info on windows
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
  • Loading branch information
arihant2math committed Feb 18, 2025
commit 1bfcb235ba4be378c102b11f95f4afbd47aa44ed
1 change: 1 addition & 0 deletions vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ features = [
"Win32_Foundation",
"Win32_System_LibraryLoader",
"Win32_System_Threading",
"Win32_System_Time",
"Win32_UI_Shell",
]

Expand Down
11 changes: 11 additions & 0 deletions vm/src/stdlib/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() };
Expand Down