Article·
Understanding Unix Timestamps
What Unix time is, why developers use it, and how to work with it across languages and time zones.
What Is Unix Time?
Unix time (epoch time) counts seconds elapsed since January 1, 1970 00:00:00 UTC. It is a single integer — timezone-agnostic and unambiguous.
Why Developers Use It
- Sorting: numbers sort correctly, no parsing
- Arithmetic: "add 1 week" = add 604800
- Storage: 8 bytes, no locale issues
- APIs: JSON-safe number or ISO 8601 string derived from it
Current Timestamp
Math.floor(Date.now() / 1000) // seconds
Date.now() // milliseconds
The Year 2038 Problem
32-bit signed integers overflow at 2,147,483,647 seconds = January 19, 2038. Modern systems use 64-bit integers, making this a non-issue for new code.
Time Zones
Unix timestamps are always UTC. Convert to local time only at the display layer — never store local time.
Convert and inspect timestamps with the Unix Timestamp Converter.