mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
time.timezone for windows
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
1 parent
72338d578b
commit
175afd97d8
1 file changed
+10
@@ -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"))]
|
||||
|
||||
Reference in new issue
Block a user