Unix 时间戳转换器

将 Unix 时间戳转换为日期,或将日期转换为秒或毫秒级时间戳。

Timestamp → date & time

Seconds or milliseconds: the unit selector decides.

Date & time → timestamp

计算原理

  1. A Unix timestamp is a count of seconds (or milliseconds) since 1970-01-01T00:00:00Z (the Unix epoch, always in UTC).
  2. Timestamp → date: the value is multiplied out to milliseconds and rendered both in UTC and in your browser’s local zone, so you can see both interpretations side by side.
  3. Date → timestamp: your wall-clock date and time are resolved in the selected IANA zone (daylight saving included) and converted to the exact instant.

使用提示

  • Seconds and milliseconds are never mixed silently: pick the unit, or use auto-detect and read the note that tells you which unit was applied.
  • The full JavaScript Date range is supported: about years −271,821 to 275,760. Values beyond it are rejected rather than wrapped.
  • Negative timestamps (before 1970) are supported everywhere on this page.

常见问题解答

What is a Unix timestamp?
A count of seconds elapsed since 00:00:00 UTC on Thursday, 1 January 1970 (the Unix epoch), not counting leap seconds. 0 is the epoch itself; negative values are instants before it.
Seconds or milliseconds: how does the converter decide?
You choose the unit explicitly, or pick auto-detect, which tells you which unit it applied (values under 100,000,000,000 are treated as seconds, above as milliseconds). Nothing is guessed silently.
How far can timestamps go?
This converter covers the full JavaScript Date range: roughly 8.64 trillion milliseconds each way from the epoch (about years −271,821 to 275,760). Values outside it are rejected with an explanation.
Why do my timestamp and your date look like different days?
Timestamps are UTC-based. Displayed as a local wall time, the same instant can fall on a different calendar date. The converter shows both so you can see exactly what happened.