From 86f289cc9bc0357303122e01afc340da3e0c37a7 Mon Sep 17 00:00:00 2001 From: Adam Spofford Date: Fri, 19 Apr 2024 21:53:12 -0400 Subject: [PATCH] Remove code for checking the local timezone --- Cargo.lock | 73 +------------------------------------------ Cargo.toml | 2 -- src/lib/format/mod.rs | 14 +-------- 3 files changed, 2 insertions(+), 87 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 624aa96..928f274 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -739,28 +739,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "chrono-tz" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" -dependencies = [ - "chrono", - "chrono-tz-build", - "phf", -] - -[[package]] -name = "chrono-tz-build" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" -dependencies = [ - "parse-zoneinfo", - "phf", - "phf_codegen", -] - [[package]] name = "ciborium" version = "0.2.2" @@ -4219,15 +4197,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "parse-zoneinfo" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" -dependencies = [ - "regex", -] - [[package]] name = "paste" version = "1.0.14" @@ -4351,35 +4320,6 @@ dependencies = [ "slog", ] -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_codegen" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" -dependencies = [ - "phf_generator", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared 0.11.2", - "rand", -] - [[package]] name = "phf_shared" version = "0.10.0" @@ -4389,15 +4329,6 @@ dependencies = [ "siphasher", ] -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - [[package]] name = "pico-args" version = "0.5.0" @@ -4711,14 +4642,12 @@ dependencies = [ "candid", "candid_parser", "chrono", - "chrono-tz", "clap", "crc32fast", "data-encoding", "flate2", "hex", "hidapi", - "iana-time-zone", "ic-agent", "ic-base-types", "ic-ckbtc-minter", @@ -5587,7 +5516,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared 0.10.0", + "phf_shared", "precomputed-hash", ] diff --git a/Cargo.toml b/Cargo.toml index ebac054..2fadc96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/src/lib/format/mod.rs b/src/lib/format/mod.rs index 99b4005..3302963 100644 --- a/src/lib/format/mod.rs +++ b/src/lib/format/mod.rs @@ -1,5 +1,4 @@ use chrono::{DateTime, TimeZone, Utc}; -use chrono_tz::{OffsetName, Tz}; use itertools::Itertools; pub mod ckbtc; @@ -10,18 +9,7 @@ pub mod nns_governance; pub mod registry; pub fn format_datetime(datetime: DateTime) -> String { - let fmt = "%b %d %Y %X"; - if let Ok(tz) = iana_time_zone::get_timezone() { - let tz = tz.parse::().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 {