Unix 时间戳转换器

在 Unix 时间戳和可读日期之间互转,支持秒、毫秒、ISO 8601 和相对时间,自动处理时区。

What is a Unix timestamp?

A Unix timestamp is the number of seconds since 00:00:00 UTC on 1 January 1970 — the moment commonly called the Unix epoch. It is a single integer, which makes it trivial to store, compare and sort.

Seconds vs milliseconds

This is the most common source of confusion:

  • 10 digits (e.g. 1736899200) — seconds
  • 13 digits (e.g. 1736899200000) — milliseconds

JavaScript's Date.now() returns milliseconds, while Math.floor(Date.now() / 1000) returns seconds. This tool detects the difference automatically from the digit count.

Common formats

FormatExample
Unix seconds1736899200
Unix milliseconds1736899200000
ISO 86012025-01-15T10:30:00Z
RFC 2822Wed, 15 Jan 2025 10:30:00 GMT
SQL datetime2025-01-15 10:30:00

The 2038 problem

The Unix epoch is near its upper limit for 32-bit signed integers: 19 January 2038. Systems storing timestamps as 32-bit integers will overflow around then. If you maintain software that will still be running, use 64-bit integers or ISO 8601 strings.

Timezone notes

Unix timestamps are always UTC. The tool shows both the UTC value and your browser's local time so you can confirm the conversion. Daylight saving shifts are handled automatically by your local timezone.

常见问题

What is a Unix timestamp?

The number of seconds since 00:00:00 UTC on 1 January 1970. It is a single integer, which makes it easy to store, compare and sort.

Is it seconds or milliseconds?

The tool works it out from the digit count. Ten digits is seconds, thirteen digits is milliseconds.

What timezone does it use?

The timestamp itself is always UTC. The output shows both the UTC value and your browser's local time so you can confirm the conversion.

What is the 2038 problem?

Unix timestamps stored as 32-bit signed integers overflow on 19 January 2038. Use 64-bit integers or ISO 8601 strings for anything long-lived.

Can I convert an ISO date string?

Yes. Paste an ISO 8601 string such as 2026-01-15T10:30:00Z and it will convert to a Unix timestamp and every other common format.