A simple CLI tool for calculating how far away dates are from each other. Inspired by WolframAlpha's ability to do this with natural language inputs.
The focus is primarily on days as the unit of time (hence the name of the crate), but support for other units of time โ both small and large โ is planned.
Features:
- Calculate the date N days from today.
- Calculate how many days are left until a given date.
- Calculate how many days have passed since a given date.
# install it
cargo install days
# use it!
days since 1970-01-01
You can always run days --help
to see the supported commands.
since
: Calculate how many days have passed since a given date.
days since 1970-01-01
until
: Calculate how many days are left until a given date.
days until 2038-01-19
count
: Calculate the date N days from today.
days count 100
The intention is to add support for natural language inputs to make it easier to use on the fly while keeping the feel of a robust CLI tool by providing consistent options for input and output formats.
Currently planned:
- Support for automatically detecting certain date formats.
- Support for manually specifying the date format you want to use.
- Options to output date results in a customisable format (or choose from a list of built-in ones).
- Options to output number-of-days results in a different unit of time (seconds, weeks, centuries).
- Support for date-and-time inputs and outputs.
- Support for calculating number of days between two arbitrary dates.
- Support for referring to past and upcoming dates by their name (like "Christmas" or "next Tuesday").
This tool is based on chrono
, the excellent Rust date/time library. Note that this has some limitations when working with dates outside of the Gregorian calendar. See their limitations section for full details.