datetime_info
Retrieve current date/time, format dates using custom patterns, or calculate the difference between two dates.
Instructions
Get current date/time, format a date, or calculate the difference between two dates. Operations: 'now' (current date/time, optional timezone), 'format' (format a date string, requires 'date' and 'format' params), 'diff' (difference between two dates, requires 'date' and 'date2' params). Date format: ISO 8601 (e.g. '2024-01-15') or natural language. Format string uses: YYYY, MM, DD, HH, mm, ss, dddd (day name).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"operation": "<operation>"
},
"name": "datetime_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date string for format/diff operations (ISO 8601 or parseable date) | |
| date2 | No | Second date for diff operation | |
| format | No | Format string for format operation, e.g. 'YYYY-MM-DD HH:mm:ss' | |
| timezone | No | Timezone for 'now' operation, e.g. 'Asia/Shanghai', 'America/New_York'. Defaults to UTC. | |
| operation | Yes | The datetime operation to perform |