mcpField
D
datetime

datetime

github.com/cadrianmaeProductivity273 installsUpdated 11w ago
Repository

About datetime

datetime is a skill that uses GNU date to parse natural-language dates and times. It is intended for tasks involving relative dates, deadlines, and current-time checks.

Key features

  1. 01Parse relative date expressions
  2. 02Handle named weekdays and offsets
  3. 03Check current date and time
  4. 04Provide command patterns and output format
  5. 05Guide handling of invalid expressions

Use cases

  1. 01Convert “next Monday at 9am” to a timestamp
  2. 02Check the current date for a time-sensitive task
  3. 03Interpret a deadline such as “in 3 days”

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/cadrianmae/claude-marketplace --skill datetime

After installing, type/datetimein Claude Code to confirm it loaded.

Bundled filesreferences/reference.md

Details

From the project README

DateTime Natural Language Parser

Parse natural language date and time expressions using GNU date command (native Linux utility).

IMPORTANT: For Claude Code

DO NOT invoke slash commands (/datetime:parse, /datetime:now, /datetime:calc) - those are for users only.

Instead, use the date command directly via the Bash tool:

# Get current date/time
date '+%Y-%m-%d %H:%M:%S (%A)'

# Parse natural language
date -d "tomorrow" '+%Y-%m-%d %H:%M:%S (%A)'
date -d "next monday at 9am" '+%Y-%m-%d %H:%M:%S (%A)'
date -d "3 days" '+%Y-%m-%d %H:%M:%S (%A)'

This skill provides the command patterns and when to use them. The slash commands are for users to invoke manually.

Quick Example

date -d "next Friday" '+%Y-%m-%d %H:%M:%S (%A)'
# 2026-02-06 00:00:00 (Friday)

When to Use This Skill

Automatically invoke when:

  • User mentions temporal expressions: "tomorrow", "next week", "in 3 days"
  • Need to verify current date/time
  • User references deadlines or time-sensitive tasks
  • context shows incorrect dates

How to Use

Use the Bash tool with date -d command:

Get current date/time:

date '+%Y-%m-%d %H:%M:%S (%A)'

Parse natural language:

date -d "tomorrow" '+%Y-%m-%d %H:%M:%S (%A)'
date -d "next wednesday" '+%Y-%m-%d %H:%M:%S (%A)'
date -d "3 days" '+%Y-%m-%d %H:%M:%S (%A)'
date -d "next monday 9am" '+%Y-%m-%d %H:%M:%S (%A)'

Important: The date command doesn't understand "in" keyword. When user says "in 3 days", use "3 days" instead.

Output Format

Returns single line: YYYY-MM-DD HH:MM:SS (DayName)

Example: 2024-10-29 14:23:45 (Tuesday)

Supported Expressions

  • Relative: "today", "tomorrow", "yesterday"
  • Named days: "next monday", "this wednesday", "last friday"
  • Offsets: "3 days", "2 weeks", "5 months ago"
  • Complex: "tomorrow 3pm", "next monday at 9am"
  • Past: "3 days ago", "last week"

Error Handling

If date -d fails with an invalid expression:

  1. Recognize the failure: If the command returns an error, inform the user the expression couldn't be parsed
  2. Try alternative approaches: Check references/reference.md for:
    • Date arithmetic examples (if user wants relative calculations)
    • Complex expression syntax (if user wants compound dates)
    • Unix timestamp calculations (if user wants day differences)
  3. Fallback to current date: If no alternative works:
    date '+%Y-%m-%d %H:%M:%S (%A)'
    

Example error handling:

# Try parsing
date -d "user expression" '+%Y-%m-%d %H:%M:%S (%A)' 2>&1
# If error message appears, tell user and suggest checking references/reference.md for advanced patterns

Advanced Usage

For relative calculations, week numbers, and complex date arithmetic, see references/reference.md.

Comments

Markdown supported