Skip to content

Commit

Permalink
refactor: replace manual sign detection with format spec "+"
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech committed Nov 5, 2024
1 parent dfeabbb commit 963372e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ lazy_static! {
static ref HOSTNAME: String = whoami::fallible::hostname().unwrap_or("No Hostname".to_string());

static ref TIMEZONE_STR: String = {
let offset = chrono::Local::now().offset().local_minus_utc() / 3600;
if offset.is_positive() {
format!(" UTC+{} ", offset.abs())
} else {
format!(" UTC-{} ", offset.abs())
}
format!(" UTC{:+} ", chrono::Local::now().offset().local_minus_utc() / 3600)
};
}

Expand Down

0 comments on commit 963372e

Please sign in to comment.