get_current_datetime
Retrieve the current date and time with customizable formatting options for year, month, day, hour, minute, and second.
Instructions
获取当前日期和时间,支持自定义格式化。
该工具返回当前的日期时间,可以指定返回的格式。如果不指定格式,默认返回 "yyyy-MM-dd" 格式。
支持的格式占位符:
yyyy: 4位年份 (例如: 2026)
MM: 2位月份 (01-12)
dd: 2位日期 (01-31)
HH: 24小时制小时 (00-23)
mm: 2位分钟 (00-59)
ss: 2位秒数 (00-59)
使用示例:
format="yyyy-MM-dd" -> "2026-03-11"
format="yyyy-MM-dd HH:mm:ss" -> "2026-03-11 14:30:00"
format="yyyy/MM/dd HH:mm" -> "2026/03/11 14:30"
注意事项:
该工具始终返回当前时间,每次调用结果可能不同
返回的是服务器本地时间
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | 日期时间格式,支持的占位符: yyyy(年份), MM(月份), dd(日期), HH(小时), mm(分钟), ss(秒). 例如: 'yyyy-MM-dd' 或 'yyyy-MM-dd HH:mm:ss' | yyyy-MM-dd |