Unix Timestamps Explained: Epoch, Seconds vs Milliseconds

What Unix time is, why it ignores leap seconds, how to tell seconds from milliseconds, and timezone pitfalls when converting.

The epoch

Unix time counts seconds elapsed since 1970-01-01T00:00:00Z (UTC). It is a single integer that describes an instant, independent of timezone — which is why it is the right storage format for events.

Seconds, milliseconds, microseconds

JavaScript Date.now() returns milliseconds; most Unix APIs return seconds. A value with 10 digits is seconds, 13 digits is milliseconds. The converter auto-detects length, and the timestamp tools show all common precisions side by side.

The year 2038 problem

32-bit signed integers overflow on 2038-01-19T03:14:07Z. Modern systems use 64-bit time; when migrating legacy databases or C code, audit every timestamp column.

Công cụ liên quan