Skip to content

Commit 4ed735b

Browse files
arihant2mathyouknowone
authored andcommitted
time.daylight for windows
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
1 parent 175afd9 commit 4ed735b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎vm/src/stdlib/time.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ mod decl {
196196
unsafe { super::c_daylight }
197197
}
198198

199+
#[cfg(target_env = "msvc")]
200+
#[cfg(not(target_arch = "wasm32"))]
201+
#[pyattr]
202+
fn daylight() -> i32 {
203+
let info = get_tz_info();
204+
// https://users.rust-lang.org/t/accessing-tzname-and-similar-constants-in-windows/125771/3
205+
(info.StandardBias != info.DaylightBias) as i32
206+
}
207+
199208
#[cfg(not(target_env = "msvc"))]
200209
#[cfg(not(target_arch = "wasm32"))]
201210
#[pyattr]

0 commit comments

Comments
 (0)