Learn
What Is a Unix Timestamp? Epoch Time Explained
A Unix timestamp is the number of seconds (or milliseconds) elapsed since January 1, 1970 00:00:00 UTC — the Unix epoch. It is the standard time representation in logs, databases, and APIs.
Seconds vs Milliseconds
Unix timestamps in seconds are 10 digits (e.g., 1716508800). JavaScript Date.now() returns milliseconds — 13 digits (e.g., 1716508800000). Always confirm which format your system uses.
Why Epoch Time?
A single integer is timezone-agnostic, sortable, and compact. Store UTC timestamps and convert to local timezone only for display.
Year 2038 Problem
32-bit signed integers overflow on January 19, 2038. Modern systems use 64-bit integers, but legacy embedded systems may still be affected.
Frequently Asked Questions
Is Unix timestamp always UTC?
Yes. Unix timestamps represent UTC time. Timezone conversion happens only when displaying to users.
How do I get the current timestamp?
JavaScript: Math.floor(Date.now() / 1000) for seconds. Python: int(time.time()). CLI: date +%s.