A powerful, interactive command-line tool for performing natural and flexible date/time arithmetic β with support for mixed durations, multiple date/time formats, and colorful prompts.
- β Add or subtract dates, times, datetimes, and durations
- π§ Accepts multiple input formats:
2024-01-10June/24/202306/10/24 15:33
- ποΈ Supports complex durations:
2years 3days1y6mo10d5w3d2h
- π» Take expression from argument or stdin
dtcalc "today + 100d"echo "now + 8h" | dtcalc
- β¨οΈ Interactive prompt with:
- Command history navigation (β / β)
- Persistent history across sessions
git clone https://github.com/hzqtc/dtcalc
cd dtcalcuv syncuv run src/dtcalc.py> today + 10 days
= 2025-06-04
> now + 10 hours
= 2025-05-25 23:24:58
> 2024-07-10 + 300 days
= 2025-05-06
> 2024-07-10 - 2023-07-10
= 366 days
> 11days + 2weeks3days
= 28 days
> 06/10/24 15:33 + 10d5h
= 2024-06-20 20:33:00