Go to file
Trey Blancher 0fe7608e87 Added README.md 2022-11-11 13:21:25 -05:00
src Initial commit of Rust date-tally 2022-11-11 12:09:09 -05:00
.gitignore Initial commit of Rust date-tally 2022-11-11 12:09:09 -05:00
Cargo.toml Initial commit of Rust date-tally 2022-11-11 12:09:09 -05:00
README.md Added README.md 2022-11-11 13:21:25 -05:00

README.md

date-tally

tblancher's date-tally program. Take's input from file or stdin, in the following log format:

tag:date

Where date is the output of the Linux or macOS date program. E.g.:

my_tag:Wed Nov  9 12:51:32 EST 2022
my_tag:Fri Nov 11 13:02:47 EST 2022

date-tally computes the number of weeks, days, hours, minutes, and seconds between successive entries in this log. E.g.:

my_tag: 0 weeks, 2 days, 0 hours, 11 minutes, 15 seconds

Note

Due to limitations of Rust's strftime implementation, the string representation of the timezone (in the example above, "EST") is ignored. This program currently assumes the timezone is US Eastern Time (America/New_York). If the log contains other timezones, we'd have to add functionality to convert the string timezone representation (with its ambiguities) to a fixed offset representation. Such changes are beyond the scope of this at the current time.