get-current-datetime — Claude Code subagent: date and time
get-current-datetime — a subagent that runs the date command with a specified timezone and returns only the raw output. Use it when you need the current date and time in a prompt without extra commentary.
MIT ★ 2,744 updated 2026-10-08
.claude/agents/get-current-datetime.mdWhat get-current-datetime does
The subagent executes TZ='Australia/Brisbane' date and outputs the result exactly as the system returns it—no formatting, headers, or explanations. You can add date flags for different formats: +"%Y-%m-%d_%H%M%S" for filenames, +"%Y-%m-%d %H:%M:%S %Z" for human-readable output, or +"%Y-%m-%dT%H:%M:%S%z" for ISO format.
It uses Bash, Read, and Write tools internally. The subagent does not spawn parallel processes and adds no explanatory text—only the command output.
What it helps with
- Get the current time in a specific timezone
- Embed the date in a filename or report
- Add a timestamp to a log or result
- Output time in ISO format for script parsing
Example prompts for the agent
- What's the current date and time in Brisbane?
- Create a filename with today's date and current time
- Add the current timestamp in ISO format to the report
How to install get-current-datetime
Manually: put the files in place
.claude/agents/get-current-datetime.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/get-current-datetime.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/get-current-datetime.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about get-current-datetime
How do I install get-current-datetime in Claude Code?
Create a file .claude/agents/get-current-datetime.md at the project root with the subagent definition. Claude Code will auto-detect and load it.
What does get-current-datetime do?
It runs date with the Australia/Brisbane timezone and returns only the output, with no formatting or explanatory text.
How can I get the date in a different format?
Specify the format in your request—for example, "Show the date in ISO format" will add +"%Y-%m-%dT%H:%M:%S%z" to the date command.
Source text
get-current-datetime.md · MIT
--- name: get-current-datetime description: Execute TZ='Australia/Brisbane' date command and return ONLY the raw output. No formatting, headers, explanations, or parallel agents. tools: Bash, Read, Write color: cyan --- Execute `TZ='Australia/Brisbane' date` and return ONLY the command output. ```bash TZ='Australia/Brisbane' date ``` DO NOT add any text, headers, formatting, or explanations. DO NOT add markdown formatting or code blocks. DO NOT add "Current date and time is:" or similar phrases. DO NOT use parallel agents. Just return the raw bash command output exactly as it appears. Example response: `Mon 28 Jul 2025 23:59:42 AEST` Format options if requested: - Filename: Add `+"%Y-%m-%d_%H%M%S"` - Readable: Add `+"%Y-%m-%d %H:%M:%S %Z"` - ISO: Add `+"%Y-%m-%dT%H:%M:%S%z"`
© centminmod · MIT · centminmod/my-claude-code-setup