Skip to content

Commit

Permalink
Remove code for checking the local timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Apr 20, 2024
1 parent b9a374d commit 86f289c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 87 deletions.
73 changes: 1 addition & 72 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ base64 = "0.13.0"
bigdecimal = "0.4"
bip32 = "0.4.0"
chrono = "0.4"
chrono-tz = "0.9"
clap = { version = "3.1.18", features = ["derive", "cargo"] }
crc32fast = "1.3.2"
data-encoding = "2.3.3"
flate2 = "1.0.22"
hex = { version = "0.4.2", features = ["serde"] }
hidapi = { version = "1.4", default-features = false, optional = true }
iana-time-zone = "0.1"
indicatif = "0.17"
itertools = "0.10.5"
k256 = { version = "0.11.4", features = ["pem"] }
Expand Down
14 changes: 1 addition & 13 deletions src/lib/format/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use chrono::{DateTime, TimeZone, Utc};
use chrono_tz::{OffsetName, Tz};
use itertools::Itertools;

pub mod ckbtc;
Expand All @@ -10,18 +9,7 @@ pub mod nns_governance;
pub mod registry;

pub fn format_datetime(datetime: DateTime<Utc>) -> String {
let fmt = "%b %d %Y %X";
if let Ok(tz) = iana_time_zone::get_timezone() {
let tz = tz.parse::<Tz>().unwrap();
format!(
"{} {}",
datetime.with_timezone(&tz).format(fmt),
tz.offset_from_utc_datetime(&datetime.naive_utc())
.abbreviation()
)
} else {
format!("{} UTC", datetime.format(fmt))
}
format!("{} UTC", datetime.format("%b %d %Y %X"))
}

pub fn format_timestamp_seconds(seconds: u64) -> String {
Expand Down

0 comments on commit 86f289c

Please sign in to comment.