Skip to main content


Rust question

Does time::OffsetDateTime::now_local() always fail in a testing context or something? It keeps returning Err(IndeterminateOffset).
#rust

Edit: it's working fine when I use it in src/main.rs.

#rust

reshared this

in reply to Jonathan Lamothe

Rust question

Sensitive content

Unknown parent

Jonathan Lamothe
@Jacob Pratt You are correct, though this behaviour is surprising to me. I am still very much a Rust newbie. Can you elaborate on what makes getting the local UtcOffset not threadsafe in such an environment?
Unknown parent

Jonathan Lamothe
@Jacob Pratt Good to know. In the meantime, I've worked around the issue by allowing a UtcOffset to be manually specified.

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.

ā‡§