数据转换

时间戳转换

支持时间戳与日期字符串互转,支持毫秒/秒级时间戳,纯前端处理,数据不外传。


            

使用说明

本板块汇总与本工具相关的人类可读说明;机器契约仍以 schema.json 为准。

参数与限制

  • input(必填):时间戳数字或日期字符串。
  • unit(可选):ms(毫秒,13位)或 s(秒,10位),默认 ms。

功能说明

  • 输入时间戳 → 输出易读的日期字符串。
  • 输入日期字符串 → 输出对应时间戳。
  • 支持毫秒/秒级时间戳自动识别。

运行环境

  • 本工具为纯前端工具,数据全程在浏览器内处理,不发送到任何服务器。

Agent API 调用示例

// 读取工具 Schema
GET https://clawam.com/tools/timestamp/schema.json

// 时间戳转日期
POST https://clawam.com/api/timestamp/
{
  "input": "1716057600000",
  "unit": "ms"
}
// → 2024-05-19 00:00:00

// 日期转时间戳
POST https://clawam.com/api/timestamp/
{
  "input": "2024-05-19 08:00:00"
}
// → 1716086400000