Unix 时间戳与可读时间双向转换,秒和毫秒自动识别,同时给出本地时间、UTC、ISO 8601 与相对时间。 Convert Unix time both ways, with seconds and milliseconds detected automatically, showing local time, UTC, ISO 8601 and relative time side by side.
Unix 时间戳是从 1970 年 1 月 1 日 00:00:00 UTC 起经过的秒数,不含时区信息——它描述的是「时间轴上的一个点」,全世界同一个瞬间对应同一个数字。所以把时间戳显示成「几点几分」必须结合时区:同一个 1700000000,在北京是 2023 年 11 月 15 日 06:13:20,在伦敦还是 11 月 14 日 22:13:20。 A Unix timestamp counts seconds since 1970-01-01 00:00:00 UTC. It carries no time zone — it identifies a point on the timeline, so the same instant is the same number everywhere. Rendering it as a clock time therefore requires a zone: 1700000000 is 2023-11-15 06:13:20 in Beijing and still 2023-11-14 22:13:20 in London.
Unix 时间戳传统上是秒,但 JavaScript 的 Date.now() 返回毫秒,Java、PHP、Python 的多数接口用秒或毫秒各半。十位数字通常是秒(对应 2001–2286 年),十三位通常是毫秒。本工具的自动识别以 1e11 为界:小于它按秒处理。拿不准时手动选单位,比猜更可靠。
Unix time is traditionally seconds, but JavaScript's Date.now() returns milliseconds, and Java, PHP and Python APIs split roughly evenly between the two. Ten digits is usually seconds (2001–2286), thirteen usually milliseconds. Auto-detection here switches at 1e11: anything smaller is treated as seconds. When unsure, pick the unit manually — safer than guessing.
用 32 位有符号整数存秒数时,最大值是 2147483647,对应 2038 年 1 月 19 日 03:14:07 UTC,再加一秒就会溢出成负数、跳回 1901 年。老式 C 程序、部分嵌入式设备和旧数据库仍受影响。现代系统多用 64 位整数,按秒计算可以撑到约 2920 亿年,本工具不受限制。 Stored in a signed 32-bit integer, seconds max out at 2147483647 — 2038-01-19 03:14:07 UTC. One second later it overflows negative and jumps back to 1901. Legacy C programs, some embedded devices and older databases are still affected. Modern systems use 64-bit integers, which last about 292 billion years at second resolution, and this tool has no such limit.
Unix 时间戳刻意忽略闰秒:出现闰秒的那一分钟在时间戳里仍是 60 秒,所以它和天文观测的 UTC 会差几秒(目前约 27 秒)。日常开发和看日志完全不必在意。时区偏移则依赖浏览器的时区数据库,本工具显示的是你这台设备当前设定的时区,跨时区协作时请以 UTC 那一行为准。 Unix time deliberately ignores leap seconds: a minute containing one still counts 60 seconds, so it drifts a few seconds from observed UTC (currently about 27 s). For everyday development and log reading this never matters. Zone offsets come from the browser's time-zone database, so this page shows the zone your device is set to — when collaborating across zones, trust the UTC row.
说明输入的数值被当成 0 或接近 0。常见原因:输入框里混进了中文标点、空格或千分位逗号;或者把毫秒当成了秒、结果落在 1970 年 1 月 1 日附近。检查输入并手动选一次单位。 The value was read as zero or near it. Common causes: Chinese punctuation, spaces or thousands separators in the field, or a millisecond value treated as seconds, which lands near 1970-01-01. Check the input and pick the unit manually once.
这里显示设备当前时区和 UTC 两种。要看第三地时间,用 UTC 那一行自行加减偏移即可;注意夏令时(DST)会让某些地区的偏移在一年中变化,跨 DST 边界时要查该地区的规则,不能简单加固定小时数。 This page shows your device's zone and UTC. For a third zone, take the UTC row and apply the offset — but remember daylight saving shifts the offset part of the year, so across a DST boundary check that region's rules rather than adding a fixed number of hours.
表示 1970 年之前的时间,Unix 时间戳本身允许负数,表示 1970-01-01 之前的秒数。历史数据、出生日期之类偶尔会用到。 A time before 1970. Unix time itself allows negatives — seconds before 1970-01-01 — which comes up with historical data and dates of birth.