Simplify the now string

This commit is contained in:
Campbell Alden 2024-12-23 16:59:09 +09:00
parent b6d1c0ea0c
commit 9087e69c79
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View file

@ -384,7 +384,7 @@ dependencies = [
[[package]] [[package]]
name = "time-track" name = "time-track"
version = "2.1.1" version = "2.1.2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "time-track" name = "time-track"
version = "2.1.1" version = "2.1.2"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -53,7 +53,8 @@ fn main() -> Result<()> {
if let Some(remaining) = first { if let Some(remaining) = first {
let now = Local::now(); let now = Local::now();
println!("Ended with unclosed span... assuming ending now: {}", now.time()); let now_str = now.format("%-I:%M %p");
println!("Ended with unclosed span... assuming ending now: {}", now_str);
total_minutes += (now - remaining).num_minutes(); total_minutes += (now - remaining).num_minutes();
} }