3.2 KiB
3.2 KiB
description, argument-hint, allowed-tools, disable-model-invocation
| description | argument-hint | allowed-tools | disable-model-invocation |
|---|---|---|---|
| Parse natural language date/time expressions (Claude should use date command directly) | <expression> [format] | Bash | true |
parse - Parse natural language date/time expressions
Parse natural language date and time expressions into standardized format.
For Claude Code
If you are Claude: DO NOT invoke this slash command. Use the date command directly via Bash tool:
date -d "expression" '+%Y-%m-%d %H:%M:%S (%A)'
See the Implementation section below for the exact command pattern.
For Users
Usage
/datetime:parse <expression>
/datetime:parse <expression> [format]
What it does
-
Standard format: Parses natural language and returns standardized date/time
- Format:
YYYY-MM-DD HH:MM:SS (DayName) - Example:
/datetime:parse "tomorrow"→2025-11-14 00:00:00 (Friday)
- Format:
-
Custom format: Parse and return in custom format
- Uses
datecommand format strings - Example:
/datetime:parse "next Monday" "%Y-%m-%d"→2025-11-17
- Uses
Implementation
Standard format:
date -d "<expression>" '+%Y-%m-%d %H:%M:%S (%A)'
Custom format:
date -d "<expression>" '+[format-string]'
Important: "in" prefix handling
- User says: "in 3 days"
- Command needs:
date -d "3 days" - Strip "in" prefix before passing to
date -d
Natural language expressions
Relative dates:
tomorrow,yesterday3 days,2 weeks,1 month,6 monthsnext Monday,last Fridaynext week,last month
Specific dates:
Nov 13,November 13,13 Nov 20252025-11-13,13/11/2025
Combined expressions:
tomorrow at 3pm→2025-11-14 15:00:00 (Friday)next Monday at 14:30→2025-11-17 14:30:00 (Monday)3 days at noon→2025-11-16 12:00:00 (Sunday)
Week navigation:
monday,tuesday(next occurrence)next monday,last tuesday
Examples
# Tomorrow
/datetime:parse "tomorrow"
→ 2025-11-14 00:00:00 (Friday)
# Relative days (strip "in" if present)
/datetime:parse "3 days"
→ 2025-11-16 00:00:00 (Sunday)
# Next week day
/datetime:parse "next Monday"
→ 2025-11-17 00:00:00 (Monday)
# With time
/datetime:parse "tomorrow at 3pm"
→ 2025-11-14 15:00:00 (Friday)
# Specific date
/datetime:parse "Nov 15"
→ 2025-11-15 00:00:00 (Saturday)
# Custom format - date only
/datetime:parse "next week" "%Y-%m-%d"
→ 2025-11-20
# Unix timestamp for calculations
/datetime:parse "3 days" "+%s"
→ 1731715200
Error handling
If the expression is invalid, date will return an error:
date -d "invalid expression"
→ date: invalid date 'invalid expression'
Common mistakes:
in 3 days→ Remove "in", use3 days3d→ Use full words:3 daysnext week monday→ Usenext mondayormonday next week
When to use
- ANY time user mentions dates, times, or temporal concepts
- Converting user's natural language into concrete dates
- Calculating deadlines from relative expressions
- Validating date inputs before processing
- Don't guess dates - always verify with this command
Related commands
/datetime:now- Get current date and time/datetime:calc- Calculate date differences