Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:03:09 +08:00
commit 1876a4de0d
8 changed files with 830 additions and 0 deletions

92
commands/now.md Normal file
View File

@@ -0,0 +1,92 @@
---
description: Get current date and time (Claude should use date command directly)
argument-hint: [format]
allowed-tools: Bash
disable-model-invocation: true
---
# now - Get current date and time
Get the current date and time in a standardized format.
## For Claude Code
**If you are Claude**: DO NOT invoke this slash command. Use the `date` command directly via Bash tool:
```bash
date '+%Y-%m-%d %H:%M:%S (%A)'
```
See the Implementation section below for the exact command pattern.
## For Users
### Usage
```bash
/datetime:now
/datetime:now [format]
```
## What it does
1. **No arguments**: Returns current date/time in standard format
- Format: `YYYY-MM-DD HH:MM:SS (DayName)`
- Example: `2024-11-13 16:45:30 (Wednesday)`
2. **With format argument**: Returns current date/time in custom format
- Uses `date` command format strings
- Example: `/datetime:now "%B %d, %Y"``November 13, 2024`
## Implementation
**Standard format:**
```bash
date '+%Y-%m-%d %H:%M:%S (%A)'
```
**Custom format:**
```bash
date '+[format-string]'
```
## Common format strings
- `%Y-%m-%d` - Date only (2024-11-13)
- `%H:%M:%S` - Time only (16:45:30)
- `%A` - Full day name (Wednesday)
- `%B %d, %Y` - Formatted date (November 13, 2024)
- `%V` - Week number (45)
- `+%s` - Unix timestamp (1699896330)
## Examples
```bash
# Standard output
/datetime:now
→ 2024-11-13 16:45:30 (Wednesday)
# Custom format - date only
/datetime:now "%Y-%m-%d"
→ 2024-11-13
# Week number
/datetime:now "%V"
45
# Unix timestamp
/datetime:now "+%s"
1699896330
```
## When to use
- Verify current date/time before making temporal decisions
- Get current week number for academic week mapping
- Generate timestamps for logging or calculations
- When <env> context date may be outdated
## Related commands
- `/datetime:parse` - Parse natural language date expressions
- `/datetime:calc` - Calculate date differences