cn-timestamp-tool - 时间戳转换工具

v1.0.0

基于纯 Python 标准库实现的时间戳与日期时间相互转换,支持当前时间戳获取和时区设置。

0· 25·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for freedompixels/cn-timestamp-tool.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "cn-timestamp-tool - 时间戳转换工具" (freedompixels/cn-timestamp-tool) from ClawHub.
Skill page: https://clawhub.ai/freedompixels/cn-timestamp-tool
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install freedompixels/cn-timestamp-tool

ClawHub CLI

Package manager switcher

npx clawhub@latest install cn-timestamp-tool
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (timestamp ↔ datetime, timezone support) align with the included Python script: no external services, no credentials, no extra binaries required. The code uses only stdlib modules (datetime, time, argparse, zoneinfo when available), which is appropriate for the stated purpose.
Instruction Scope
SKILL.md usage examples reference running `python3 cn_timestamp_tool.py`, but the provided script is `scripts/timestamp_tool.py`. This filename mismatch means the runtime instructions may be incorrect as packaged. Aside from that, the instructions and script are narrowly scoped to timestamp/datetime operations and do not access unrelated files, env vars, or network endpoints.
Install Mechanism
No install spec and no external downloads; the skill is instruction + a small script, so nothing is written to disk by an installer. Low risk.
Credentials
No environment variables, credentials, or config paths are requested. The use of zoneinfo is optional (the script falls back if unavailable). No disproportionate access is requested.
Persistence & Privilege
The skill does not request persistent or elevated presence (always is false). It does not modify other skills or system configuration.
Assessment
This appears to be a simple, self-contained timestamp conversion script. Before installing or running it: 1) note the SKILL.md examples call `cn_timestamp_tool.py` but the included script path is `scripts/timestamp_tool.py` — you may need to rename or run the correct path. 2) ZoneInfo support depends on Python version; if unavailable the tool will produce naive datetimes (no timezone applied). 3) The ms/seconds detection uses a heuristic (ts > 10**10 treated as milliseconds) which is fine for typical uses but keep in mind for edge cases. No credentials, external network calls, or installer downloads were found.

Like a lobster shell, security has layers — review code before you run it.

latestvk9707nfjh4rwg5kt8y0jn8qkk585n3jy
25downloads
0stars
1versions
Updated 5h ago
v1.0.0
MIT-0

cn-timestamp-tool - 时间戳转换工具

纯 Python 标准库实现的时间戳转换工具。

功能

  • 时间戳 → 日期时间:将 Unix 时间戳转换为可读日期时间
  • 日期时间 → 时间戳:将日期时间转换为 Unix 时间戳
  • 当前时间戳:获取当前 Unix 时间戳(秒/毫秒)
  • 时区支持:支持不同时区的转换

使用方式

# 当前时间戳(秒)
python3 cn_timestamp_tool.py now

# 当前时间戳(毫秒)
python3 cn_timestamp_tool.py now-ms

# 时间戳转日期时间
python3 cn_timestamp_tool.py to-datetime 1714214400

# 日期时间转时间戳
python3 cn_timestamp_tool.py to-timestamp "2024-04-27 14:30:00"

# 指定格式输出
python3 cn_timestamp_tool.py format 1714214400 "%Y年%m月%d日 %H:%M:%S"

# 带时区转换
python3 cn_timestamp_tool.py to-datetime 1714214400 -z Asia/Shanghai

技术说明

  • 纯 Python 标准库(datetimetimeargparsezoneinfo
  • 无外部依赖
  • 默认时区 Asia/Shanghai

Comments

Loading comments...