A CLI for time arithmetic. Inspired by when. Try it online.
Examples:
2023/12/25 - 7d→ subtracts 7 days from December 25, 20232am + 30m→ adds 30 minutes to 2:00 AMtoday - 2025/12/25-> days until December 25, 2025
Run without installing: cargo run -p cli -- "2am + 30m"
- Dates use
YYYY/MM/DDand can include time asYYYY/MM/DD HH:MM. - Times accept 24-hour
HH:MMorH[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).