delt is a command-line tool designed for calculating the elapsed time between two timestamps in a human-readable format. It leverages the Arrow
library for handling date and time manipulations and Typer
for creating a user-friendly command-line interface.
- Calculate the time difference between two timestamps.
- Present results in a human-readable format, indicating if the time is in the past or the future.
- Handle edge cases (e.g., timestamps within 10 seconds of the current time).
- Display the current version of the tool.
To install the tool using uv
, run:
uv tool install https://github.com/brandonleon/delt.git
Once installed, the tool is accessible via the delt
command. Run it as follows:
delt <start_timestamp> [<end_timestamp>
-
Calculate the elapsed time between two timestamps:
delt "2024-11-14 15:00:00" "2024-11-14 16:00:00"
Output:
1 hour
-
Calculate the elapsed time from a given timestamp to the current time:
delt "2024-11-14 15:00:00"
Output (varies based on the current time):
10 minutes ago
To see the version of delt
, run:
delt --version
Output:
delt version 0.3.7
- Arrow: A powerful library for date and time manipulations.
- Typer: A library for building intuitive CLI applications.
This project is licensed under the Creative Commons Attribution License (CC BY). You are free to use, distribute, remix, adapt, and build upon this work, even commercially, as long as you credit the original creator.