Relative time representations with language support.
- Expresses dates and times in natural, human-readable forms
- Supports relative (today, tomorrow), named (Monday, January), and exact representations
- Optional Swedish language support (enabled by default)
- JSON Schema generation via schemars
- Serialisation to natural JSON formats
The CLI converts time expressions to their earliest or latest possible timestamps.
cargo install --path cliConvert a time expression to its earliest timestamp:
reltime min today
reltime min monday
reltime min date 12 25 # 25th December this yearConvert to the latest timestamp:
reltime max today # midnight tomorrow
reltime max this-week # midnight next MondaySpecify a reference time:
reltime min --relative-to 2025-07-29T10:30:05Z todayGenerate JSON Schema:
reltime schema > schema.jsonAll types implement JsonSchema from the schemars crate. Generate a schema file for use with yaml-language-server or other schema-aware tools:
cd cli
cargo run -- schema > ../schema.jsonCreate a todo.yaml with schema validation:
# yaml-language-server: $schema=./schema.json
---
- task: Review pull requests
due: Today
- task: Team meeting
due: "14:30"
- task: Deploy to production
due: Friday
- task: Q1 planning
due: JanuaryAnother example with exact dates:
# yaml-language-server: $schema=./schema.json
---
- task: Birthday present
due: "25/12" # 25th December (recurring)
- task: Project deadline
due: "15/3/2025 17:00" # 15th March 2025 at 5pm
- task: Morning standup
due: "09:00"
- task: End of sprint
due: ThisWeekBy default, Swedish variants are available alongside English:
{
"due": "Måndag"
}To disable Swedish support, compile without default features:
cargo build --no-default-features