Epoch Time Converter
/install epoch-time-converter
Epoch Time Converter
Overview
Two-way conversion between Unix epoch timestamps and human-readable datetimes, with explicit timezone handling. Backed by a single self-contained Python script that uses only the standard library (datetime, zoneinfo).
Quick start
# Epoch seconds -> human time in a given timezone
python3 scripts/epoch.py to-date 1700000000 --tz Asia/Shanghai
# -> 2023-11-15 06:13:20 +08:00 (Asia/Shanghai)
# Epoch milliseconds -> human time
python3 scripts/epoch.py to-date 1700000000000 --unit ms --tz UTC
# Human time -> epoch seconds (input timezone is required)
python3 scripts/epoch.py to-epoch "2023-11-15 06:13:20" --tz Asia/Shanghai
# -> 1700000000
# Human time -> epoch milliseconds
python3 scripts/epoch.py to-epoch "2023-11-15T06:13:20" --tz Asia/Shanghai --unit ms
Decision tree
- Input is purely numeric → use
to-date.- 10 digits →
--unit s(default). - 13 digits →
--unit ms.
- 10 digits →
- Input looks like a date/time string → use
to-epochand require--tz. - If the user did not specify a timezone for
to-date, default to UTC and explicitly tell them which timezone you used.
Output format
Both subcommands print one line: \x3Cvalue> (\x3Ccontext>). Always echo this raw output back to the user, then add a one-line plain-language summary.
Edge cases to watch
- Bare numbers without a unit hint: prefer length-based detection (10 vs 13 digits) over guessing.
- Strings without timezone offsets (e.g.
2024-01-01 09:00) are interpreted in the--tzvalue; do not silently fall back to system local time. - Negative epoch values (pre-1970) are supported.
Resources
scripts/
epoch.py— CLI implementingto-dateandto-epoch. Pure stdlib; runs on any Python 3.9+.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install epoch-time-converter - 安装完成后,直接呼叫该 Skill 的名称或使用
/epoch-time-converter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Epoch Time Converter 是什么?
Convert between Unix epoch timestamps (seconds or milliseconds) and human-readable date strings in any IANA timezone. Use when the user provides a number tha... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 44 次。
如何安装 Epoch Time Converter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install epoch-time-converter」即可一键安装,无需额外配置。
Epoch Time Converter 是免费的吗?
是的,Epoch Time Converter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Epoch Time Converter 支持哪些平台?
Epoch Time Converter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Epoch Time Converter?
由 terrycarter1985(@terrycarter1985)开发并维护,当前版本 v0.1.0。