Skip to content

Commit c717ddb

Browse files
committed
linux returns GMT, macos returns UTC
1 parent e6a79e3 commit c717ddb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎libcc2rs/src/libc_shims/time.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ impl Tm {
3333
*tm.tm_yday.borrow_mut() = dt.day_of_year() as i32 - 1;
3434
*tm.tm_isdst.borrow_mut() = 0;
3535
*tm.tm_gmtoff.borrow_mut() = dt.offset().seconds() as i64;
36-
*tm.tm_zone.borrow_mut() = Ptr::from_string_literal(b"GMT");
36+
#[cfg(target_os = "linux")]
37+
let zone: &'static [u8] = b"GMT";
38+
#[cfg(target_os = "macos")]
39+
let zone: &'static [u8] = b"UTC";
40+
*tm.tm_zone.borrow_mut() = Ptr::from_string_literal(zone);
3741
tm
3842
}
3943

0 commit comments

Comments
 (0)