Crates.io | timecalc |
lib.rs | timecalc |
version | |
source | src |
created_at | 2024-04-06 20:33:14.38769 |
updated_at | 2024-12-21 19:47:40.660583 |
description | Calculate the total duration of a given set of intervals and durations |
homepage | |
repository | https://github.com/granddave/timecalc-rs/ |
max_upload_size | |
id | 1198537 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Timecalc is a simple CLI tool that calculates the total time spent on a project given intervals and durations.
This is the Rust implementation of my previous tool written in Python.
Timecalc is available as both a crate and as a standalone binary. See the installation instructions on how to install it, or the documentation for more information about the crate.
$ timecalc --help
Calculate the total duration of a given set of intervals and durations.
Usage: timecalc [OPTIONS] [DURATION_ARGS]...
Arguments:
[DURATION_ARGS]... Intervals or durations to sum
Intervals are specified as `start-end`, e.g. `9-12:30`.
Durations are specified as `+duration` or `-duration`, e.g. `1h` or `-30m`.
Valid duration units are:
w for weeks
d for days
h for hours
m for minutes
Options:
-s, --stdin Read arguments from stdin
-h, --help Print help
-V, --version Print version
Let's say you worked on a project from 7:00 to 11:30, including a 15 minute break, and then worked another 4 hours after lunch. You can calculate the total time spent on the project like this:
$ timecalc 7-11:30 -15m 4h
8h 15m
# or via stdin
$ echo 7-11:30 -15m 4h | timecalc -s
8h 15m
The latest release can be downloaded as a standalone binary from the releases page.
cargo
It can also be compiled and installed via cargo
:
cargo install timecalc
This project is licensed under the MIT License - see the LICENSE file for details