time.timezone for windows

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
Ashwin Naren authored and Jeong, YunWon committed 2025-02-18 15:50:27 +09:00
1 parent 72338d578b
commit 175afd97d8
1 file changed
+10
+10
View File
@@ -178,6 +178,16 @@ mod decl {
unsafe { super::c_timezone }
}
#[cfg(target_env = "msvc")]
#[cfg(not(target_arch = "wasm32"))]
#[pyattr]
fn timezone() -> i32 {
let info = get_tz_info();
// https://users.rust-lang.org/t/accessing-tzname-and-similar-constants-in-windows/125771/3
(info.Bias + info.StandardBias) * 60
}
#[cfg(not(target_os = "freebsd"))]
#[cfg(not(target_env = "msvc"))]
#[cfg(not(target_arch = "wasm32"))]