Closed ian-h-chamberlain closed 2 years ago
We could add libc::tm::tm_gmtoff
to our libc fork, if we wanted.
We could add
libc::tm::tm_gmtoff
to our libc fork, if we wanted.
No we can't. Newlib
(at least devkitARM's 3DS fork) doesn't support it in it's functions. Sad, yeah, but it's normal when working with literally any unix target other than linux.
Depends on https://github.com/Meziu/rust-linker-fix-3ds/pull/6
Couple of notes:
time
crate does not enable itslocal-offset
feature by default and therefore does not uselibc::tm::tm_gmtoff
, which is missing from the newlib definitions: https://github.com/rust-lang/libc/blob/master/src/unix/newlib/mod.rs#L105chrono
seems like a slightly nicer crate to use, but it does support some timezone-awareness by default, and fails to build due to the aforementionedtm_gmtoff
. Probably a PR upstream forchrono
to supporttarget_env = "newlib"
more gracefully could resolve that, but it seemed a little beyond me...For
time
itself:formatting
feature which allows a format like"[hour]:[minute]:[second]"
, but what I have now seems slightly more rust-idiomatic to me at least? I can enable that feature and use it if that seems preferable/time
provides that stuff itself.