← 返回 Skills 市场
terrycarter1985

Epoch Time Converter

作者 terrycarter1985 · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
44
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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

  1. Input is purely numeric → use to-date.
    • 10 digits → --unit s (default).
    • 13 digits → --unit ms.
  2. Input looks like a date/time string → use to-epoch and require --tz.
  3. 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 --tz value; do not silently fall back to system local time.
  • Negative epoch values (pre-1970) are supported.

Resources

scripts/

  • epoch.py — CLI implementing to-date and to-epoch. Pure stdlib; runs on any Python 3.9+.
安全使用建议
Installers should understand that the skill runs a local Python script to convert timestamps and dates. Confirm the intended timezone and whether the timestamp is in seconds or milliseconds, but there is no artifact-backed security concern beyond normal local script execution.
能力评估
Purpose & Capability
The artifacts consistently describe and implement Unix epoch/date conversion with timezone handling using a single Python standard-library CLI.
Instruction Scope
Runtime instructions are limited to choosing conversion direction, timezone, seconds versus milliseconds, and echoing the CLI result; no unrelated agent behavior or prompt manipulation is present.
Install Mechanism
No package dependencies, install hooks, or external downloads are declared; the only executable artifact is the disclosed conversion script.
Credentials
The script uses argparse, datetime, sys, and zoneinfo only, which is proportionate for local timestamp conversion and does not access files, network, credentials, or private data.
Persistence & Privilege
No persistence, background execution, privilege escalation, credential/session use, or mutation of user data is present.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install epoch-time-converter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /epoch-time-converter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release: bidirectional Unix epoch <-> datetime conversion with IANA timezone support and a self-contained Python CLI.
元数据
Slug epoch-time-converter
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论