tcalc-cli

Crates.iotcalc-cli
lib.rstcalc-cli
version0.1.2
created_at2025-12-08 08:55:47.816738+00
updated_at2025-12-13 16:23:51.755882+00
descriptionA CLI for time arithmetic.
homepage
repositoryhttps://github.com/domenicocinque/tcalc
max_upload_size
id1973011
size12,854
Domenico (domenicocinque)

documentation

README

tcalc

A CLI for time arithmetic. Inspired by when. Try it online.

Examples:

  • 2023/12/25 - 7d → subtracts 7 days from December 25, 2023
  • 2am + 30m → adds 30 minutes to 2:00 AM
  • today - 2025/12/25 -> days until December 25, 2025

Usage

Run without installing: cargo run -p cli -- "2am + 30m"

Syntax

  • Dates use YYYY/MM/DD and can include time as YYYY/MM/DD HH:MM.
  • Times accept 24-hour HH:MM or H[am|pm] forms (2pm → 14:00).
  • Keywords: today, tomorrow, yesterday, now.
  • Durations combine a number with a unit: y, year, month, day|d, hour|h, minute|m, second|s.
  • Combine values with + and -, chaining operations left-to-right (today - 2h + 30m).
Commit count: 0

cargo fmt