Unix Timestamp Explained: What It Is & How to Convert Epoch Time (2026)
Published April 2, 2026
Every second that passes is recorded as a number by computers worldwide. That number is the Unix timestamp (also called Epoch time or POSIX time). Understanding it is essential for any developer working with dates and times.
What is a Unix Timestamp?
A Unix timestamp is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC (excluding leap seconds). This moment is called the Unix Epoch.
January 1, 1970 00:00:00 UTC → 0
January 1, 1970 00:01:00 UTC → 60
January 1, 2026 00:00:00 UTC → 1767225600
April 2, 2026 12:00:00 UTC → 1743595200
Why Use Unix Timestamps?
- Timezone-independent — Always UTC, no ambiguity
- Easy to compare — Later times have larger numbers
- Easy to calculate — Subtract two timestamps to get the difference in seconds
- Universal — Every programming language and database supports it
- Compact — A single integer vs. a complex date string
The Year 2038 Problem
On January 19, 2038 at 03:14:07 UTC, the Unix timestamp will reach 2147483647 — the maximum value for a 32-bit signed integer. Systems using 32-bit timestamps will overflow, similar to the Y2K bug.
Most modern systems have already switched to 64-bit timestamps, which won't overflow for 292 billion years.
Converting Timestamps in Different Languages
# JavaScript
Math.floor(Date.now() / 1000) // Current timestamp
new Date(1743595200 * 1000) // Timestamp to Date
# Python
import time
int(time.time()) // Current timestamp
time.strftime('%Y-%m-%d', time.localtime(1743595200)) // To string
# Java
Instant.now().getEpochSecond() // Current timestamp
Instant.ofEpochSecond(1743595200) // Timestamp to Instant
# SQL
SELECT UNIX_TIMESTAMP(); // Current timestamp
SELECT FROM_UNIXTIME(1743595200); // To datetime
Common Timestamp Formats
| Format | Example | Used In |
|---|---|---|
| Seconds | 1743595200 | Unix, Linux, most APIs |
| Milliseconds | 1743595200000 | JavaScript, Java |
| Microseconds | 1743595200000000 | Python time.time() |
| ISO 8601 | 2026-04-02T12:00:00Z | REST APIs, JSON |