Skip to main content

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 — Years
  • mo, month, months — Months
  • w, week, weeks — Weeks
  • d, day, days — Days
  • h, hour, hours — Hours
  • m, min, minute, minutes — Minutes
  • s, 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

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)

Source distribution for datemath-cli 0.1.0
File Size Uploaded
datemath_cli-0.1.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datemath-cli 0.1.0
File Interpreter ABI Platform
datemath_cli-0.1.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page