Skip to content

Commit

Permalink
Bump chrono from 0.4.26 to 0.4.27 (#27)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <[email protected]>
  • Loading branch information
dependabot[bot] and robjtede authored Aug 30, 2023
1 parent fd8dc8c commit fcde98d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"cSpell.words": [
"byteorder",
"chrono",
"datetime",
"extn",
"itertools",
"memchr",
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
byteorder = "1"
chrono = { version = "0.4.26", default-features = false, features = ["clock", "serde"] }
chrono = { version = "0.4.27", default-features = false, features = ["clock", "serde"] }
const-oid = { version = "0.9", features = ["std", "db"] }
ct-sct = "0.1"
der = { version = "0.7", features = ["std"] }
Expand Down
6 changes: 2 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use std::io::Read;

use chrono::TimeZone as _;
use const_oid::{
db::{rfc5280, rfc5912, Database, DB},
ObjectIdentifier,
Expand Down Expand Up @@ -53,10 +54,7 @@ pub(crate) fn duration_since_now_fmt(time: x509_cert::time::Time) -> String {

let ts = time.to_unix_duration().as_secs() as i64;

let date = DateTime::<Utc>::from_utc(
chrono::NaiveDateTime::from_timestamp_opt(ts, 0).unwrap(),
Utc,
);
let date = Utc.from_utc_datetime(&chrono::NaiveDateTime::from_timestamp_opt(ts, 0).unwrap());
let now = Utc::now();

let duration = if now > date { now - date } else { date - now };
Expand Down

0 comments on commit fcde98d

Please sign in to comment.