1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

deps: fix clippy warning for chrono usage

This commit is contained in:
Niyaz Nigmatullin 2022-11-15 17:52:20 +02:00
parent af2833761c
commit 012bb7e3d8

View file

@ -44,7 +44,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Err(USimpleError::new(1, "could not retrieve system uptime"))
} else {
if matches.get_flag(options::SINCE) {
let initial_date = Local.timestamp(Utc::now().timestamp() - uptime, 0);
let initial_date = Local
.timestamp_opt(Utc::now().timestamp() - uptime, 0)
.unwrap();
println!("{}", initial_date.format("%Y-%m-%d %H:%M:%S"));
return Ok(());
}