Skip to content

Commit

Permalink
Merge pull request #6414 from cakebaker/pinky_fix_idle_string
Browse files Browse the repository at this point in the history
pinky: use UTC if offset can't be determined
  • Loading branch information
sylvestre authored May 19, 2024
2 parents 2e16cbb + 00b2dc3 commit f013d23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uu/pinky/src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f013d23

Please sign in to comment.