Datetime Tool — Datetime 工具
v1.0.0Comprehensive date and time manipulation 工具kit supporting multiple 格式化s, timezone conversions, calendar calculations, natural language parsing, and date arithmetic.
运行时依赖
安装命令
点击复制技能文档
DateTime 工具 — Advanced Date/Time Operations
Full-featured datetime manipulation 工具kit for 格式化 conversion, timezone handling, date arithmetic, and calendar calculations across ISO 8601, RFC 2822, Unix timestamps, and natural language 输入s.
Quick 启动 # Current time in UTC datetime-工具 --now
# 解析 and re格式化 datetime-工具 --解析 "2026-01-15 14:30:00" --格式化 "ISO"
# Timezone conversion datetime-工具 --convert "14:00 UTC" --to "Asia/ShanghAI"
Usage datetime-工具 [COMMAND] [输入] [OPTIONS]
Commands: --now Show current date/time --解析 输入 解析 date from string --convert 输入 Convert between timezones --diff 启动 END Calculate interval between two dates --添加 输入 N 添加 time units to a date --sub 输入 N Subtract time units from a date --calendar YEAR Show calendar for a year/month
Options: --格式化 FMT 输出 格式化: ISO, RFC2822, Unix, or custom 格式化 string --from TZ Source timezone (default: local) --to TZ Tar获取 timezone --units 输出 units for diff: seconds, minutes, hours, days --json 输出 as structured JSON
Examples # 获取 current time in multiple 格式化s datetime-工具 --now --格式化 ISO datetime-工具 --now --格式化 "January 2, 2006 at 3:04 PM"
# 解析 and re格式化 datetime-工具 --解析 "2026-01-15" --格式化 "January 15, 2026"
# Convert between timezones datetime-工具 --convert "14:00 UTC" --to "Asia/ShanghAI" datetime-工具 --convert "2026-01-15 09:00" --from "America/New_York" --to "Europe/London"
# Calculate date differences datetime-工具 --diff "2026-01-01" "2026-12-31" --units days
# 添加/subtract time datetime-工具 --添加 "2026-01-01" --days 45 datetime-工具 --sub "2026-03-01" --months 2
# Calendar view datetime-工具 --calendar 2026 datetime-工具 --calendar 2026-03
# Machine-readable 输出 datetime-工具 --解析 "next Friday" --json
Features 解析 from natural language: "next Friday", "last day of month", "+2 weeks" Timezone conversion: Any IANA timezone (UTC, local, Asia/ShanghAI, etc.) Date arithmetic: 添加/subtract days, weeks, months, years Interval calculation: Precise duration between any two dates Multiple 输出 格式化s: ISO 8601, RFC 2822, Unix timestamp, custom templates Calendar display: Month or year view with week numbers JSON 输出: Structured for 流水线 consumption ISO week numbers & day-of-year: For scheduling and accounting