Unix Timestamp Converter|Unix 时间戳转换器

Unix 时间戳转换器 | Unix Timestamp Converter

Unix 时间戳转换器 Unix Timestamp Converter

Unix 秒/毫秒 ↔ 日期时间,支持本地时间与 UTC,并支持批量转换。
Convert Unix seconds/milliseconds ↔ DateTime (Local & UTC) with batch conversion.

1. 输入参数 · Inputs
规则:Auto 会按位数与量级判断:13 位通常按毫秒,10 位通常按秒。
Rule: Auto detects by digits/magnitude: 13-digit usually ms, 10-digit usually s.
小提示:如果你粘贴的是带空格/换行的内容,本工具会自动去掉空白。
Tip: pasted text may include spaces/newlines — we auto-trim them.
按本地解释:把输入当作你电脑所在时区的本地时间(常见场景)。
Interpret as Local: treat input as your computer’s local timezone (most common).
按 UTC 解释:把输入当作 UTC 时间(适合接口/日志/服务器场景)。
Interpret as UTC: treat input as UTC time (APIs/logs/server usage).
注意:datetime-local 本身不带时区信息,所以“解释方式”非常关键。
Note: datetime-local has no timezone info — the chosen interpretation matters.
3. 批量转换 · Batch Convert
批量模式会逐行尝试解析:
1)纯数字 → 当作 Unix 时间戳(秒/毫秒自动识别或按规则推断)。
2)带 Z / +08:00 → 当作 ISO(含时区)。
3)形如 YYYY-MM-DD HH:mm:ss → 当作本地时间(Local)。

Batch parser tries per line:
(1) digits → Unix timestamp (auto detect s/ms).
(2) ISO with timezone (Z / +08:00) → parsed as absolute time.
(3) “YYYY-MM-DD HH:mm:ss” → treated as Local time.

输出里无法解析的行会标注为 ERR,不影响其它行。
Unparsable lines are marked as ERR, others continue.
常用用途:日志对齐、接口调试、数据库排查、量化交易数据时间字段核对。
Typical use cases: log alignment, API debugging, DB troubleshooting, trading/quant timestamp checks.
4. 使用说明 · Notes
  • 秒 vs 毫秒(最容易踩坑) · Seconds vs Milliseconds (most common pitfall):
    很多后端/数据库使用 (10 位),而 JavaScript/前端埋点常用 毫秒(13 位)。
    Many backends/DBs use seconds (10 digits), while JS/frontend events often use milliseconds (13 digits).
    如果你转换出来的日期跑到了 1970 年附近或遥远未来,十有八九是单位选错了。
    If the result lands near 1970 or far in the future, you likely picked the wrong unit.
  • 本地时间 vs UTC(第二大坑) · Local vs UTC (second biggest pitfall):
    UTC 是统一时间标准;本地时间 会随着你电脑所在时区变化。
    UTC is a universal reference; Local depends on your device timezone.
    同一个 Unix 时间戳,在不同地区显示的“本地时间”会不同,但 UTC 是一致的。
    The same Unix timestamp shows different local times across regions, but UTC remains consistent.
  • 为什么 datetime-local 不带时区? · Why does datetime-local have no timezone?
    它只是一串“年月日时分”的输入控件,不携带时区信息,所以你必须选择“按本地解释/按 UTC 解释”。
    It is just a plain date-time input without timezone info — that’s why you must choose how to interpret it.
  • 批量转换的推荐格式 · Recommended batch formats:
    ✅ Unix:1700000000 / 1700000000000
    ✅ ISO:2025-12-16T12:30:00Z(带 Z = UTC,最稳定)
    ✅ 本地文本:2025-12-16 20:30:00(默认按本地解析)
    推荐你在跨系统/跨地区沟通时优先使用 ISO + Z,减少歧义。
    Prefer ISO with Z when working across systems/regions to avoid ambiguity.
  • 精度提示 · Precision note:
    Unix 秒只能到“秒级”,Unix 毫秒可到“毫秒级”。如果你只存秒,毫秒会被截断。
    Seconds are only second-precision; milliseconds keep ms-precision. If you store only seconds, ms will be truncated.

说明:本工具在浏览器本地运行,不会上传你的数据。结果用于学习、调试与时间字段核对,不构成任何业务/金融/合规建议。
Note: Runs fully in your browser; no data is uploaded. For learning/debugging/time-field verification only. Not business/financial/compliance advice.