diff --git a/Cargo.lock b/Cargo.lock index ae5096f86..e8a37021b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,9 +233,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "iana-time-zone", "num-integer", diff --git a/Cargo.toml b/Cargo.toml index 509dc5cc1..251d508fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -384,7 +384,7 @@ yes = { optional=true, version="0.0.16", package="uu_yes", path="src/uu/yes #pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`) [dev-dependencies] -chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]} +chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]} conv = "0.3" filetime = "0.2" glob = "0.3.0" diff --git a/src/uu/date/Cargo.toml b/src/uu/date/Cargo.toml index ffca6d3a4..1f3777487 100644 --- a/src/uu/date/Cargo.toml +++ b/src/uu/date/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" path = "src/date.rs" [dependencies] -chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]} +chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]} clap = { version = "4.0", features = ["wrap_help", "cargo"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore" } diff --git a/src/uu/du/Cargo.toml b/src/uu/du/Cargo.toml index b9a3f71fc..3a188e0c3 100644 --- a/src/uu/du/Cargo.toml +++ b/src/uu/du/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" path = "src/du.rs" [dependencies] -chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]} +chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]} # For the --exclude & --exclude-from options glob = "0.3.0" clap = { version = "4.0", features = ["wrap_help", "cargo"] } diff --git a/src/uu/ls/Cargo.toml b/src/uu/ls/Cargo.toml index c4233a3b3..cdaac6e61 100644 --- a/src/uu/ls/Cargo.toml +++ b/src/uu/ls/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" path = "src/ls.rs" [dependencies] -chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]} +chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]} clap = { version = "4.0", features = ["wrap_help", "cargo", "env"] } unicode-width = "0.1.8" number_prefix = "0.4" diff --git a/src/uu/uptime/Cargo.toml b/src/uu/uptime/Cargo.toml index 633c3ba1c..367256814 100644 --- a/src/uu/uptime/Cargo.toml +++ b/src/uu/uptime/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" path = "src/uptime.rs" [dependencies] -chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]} +chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]} clap = { version = "4.0", features = ["wrap_help", "cargo"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["libc", "utmpx"] } diff --git a/src/uu/uptime/src/uptime.rs b/src/uu/uptime/src/uptime.rs index 6b3ead6e9..567761ad9 100644 --- a/src/uu/uptime/src/uptime.rs +++ b/src/uu/uptime/src/uptime.rs @@ -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(()); }