mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
pinky: use UTC if offset can't be determined
This commit is contained in:
parent
2e16cbbd7a
commit
00b2dc3b56
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ struct Pinky {
|
|||
|
||||
fn idle_string(when: i64) -> String {
|
||||
thread_local! {
|
||||
static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap();
|
||||
static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap_or_else(|_| time::OffsetDateTime::now_utc());
|
||||
}
|
||||
NOW.with(|n| {
|
||||
let duration = n.unix_timestamp() - when;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue