datemath
Natural language date calculations and formatting.
A simple CLI for working with dates, times, and durations. Designed for humans and AI agents alike.
Installation
pip install datemath-cli
Usage
Current Time
datemath now # Show current time in multiple formats
datemath now --tz UTC # In specific timezone
datemath now --json # JSON output
Add Duration
datemath add "3 weeks" # 3 weeks from now
datemath add "2 months" # 2 months from now
datemath add "1 year 2 months" # Combine units
datemath add "5 days" --from "2026-01-01" # From specific date
Subtract Duration
datemath sub "1 week" # 1 week ago
datemath sub "3 months" # 3 months ago
Between Dates
datemath between "2026-01-01" "2026-12-31" # Days/weeks/months between
datemath between "today" "2026-12-25" # Until Christmas
datemath between "yesterday" "tomorrow" # 2 days
Parse Natural Language
datemath parse "next tuesday" # Parse to ISO date
datemath parse "tomorrow" # Tomorrow's date
datemath parse "in 3 weeks" # 3 weeks from now
datemath parse "2 days ago" # 2 days ago
datemath parse "last friday" # Previous Friday
Format Dates
datemath format "2026-02-03" --fmt "%B %d, %Y" # February 03, 2026
datemath format "tomorrow" --fmt "%A" # Weekday name
datemath format "now" --fmt "%Y%m%d_%H%M%S" # Filename-safe
Timezone Conversion
datemath tz "2026-02-03T12:00" --from UTC --to America/Los_Angeles
datemath tz "now" --from America/New_York --to Europe/London
datemath zones # List common timezones with current time
Duration Syntax
Supported units:
y,year,years— Yearsmo,month,months— Monthsw,week,weeks— Weeksd,day,days— Daysh,hour,hours— Hoursm,min,minute,minutes— Minutess,sec,second,seconds— Seconds
Combine freely: "1 year 2 months 3 days", "1y 2mo 3d", "90 days"
JSON Output
All commands support --json for machine-readable output:
datemath now --json
{
"iso": "2026-02-03T12:00:00",
"unix": 1770184800,
"date": "2026-02-03",
"time": "12:00:00",
"human": "February 03, 2026 at 12:00 PM",
"weekday": "Tuesday",
"timezone": "local"
}
For AI Agents
See SKILL.md for agent-optimized documentation.
License
MIT
Metadata
Release files for datemath-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datemath_cli-0.1.0.tar.gz | 5.5 kB | Without provenance | Details for datemath_cli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datemath_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for datemath_cli-0.1.0-py3-none-any.whl |
Total release size: 11.2 kB
Release files / datemath_cli-0.1.0.tar.gz
| Download URL | datemath_cli-0.1.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f41caf4c573f628d41576d60d7f6754f38f1d01cc7d7371458883f15591c7ec
|
|
BLAKE2b-256 checksum How to use checksums |
a0346676455bd41341614f61f92420e97136704566e3556cd6444a9dd036a602
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / datemath_cli-0.1.0-py3-none-any.whl
| Download URL | datemath_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82b4495a63403f2fc6bb2d65b633cf241e35dfef12d53d8646607c1762fec182
|
|
BLAKE2b-256 checksum How to use checksums |
50d13387e2f2950f1092e2988126fdaf344a9dc5e39cc0076e84f53798c71260
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for datemath-cli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.