If you've ever worked with APIs or databases, you've seen numbers like 1735689600. That's a Unix timestamp — the number of seconds since January 1, 1970.
This guide explains what Unix timestamps are, why they're used everywhere, and how to convert them.
What Is a Unix Timestamp?
A Unix timestamp is a single number representing a specific moment in time. It's defined as the number of seconds that have passed since 1970-01-01 00:00:00 UTC.
Examples:
| Timestamp | Date (UTC) |
|---|---|
| 0 | 1970-01-01 00:00:00 |
| 1000000000 | 2001-09-09 01:46:40 |
| 1735689600 | 2025-01-01 00:00:00 |
Why Unix Timestamps Are Used
1. Timezone-Independent
A timestamp is the same everywhere on Earth. No confusion about timezones — you always know exactly when something happened.
2. Easy to Compare
Comparing two timestamps is just a numerical comparison. Trying to compare "2025-01-01 10:00:00 EST" with "2025-01-01 15:00:00 UTC" is much harder.
3. Compact
A 10-digit number is smaller than a formatted date string. This matters when you're storing millions of records.
4. Sortable
Timestamps sort numerically. You can sort by time without parsing strings.
Seconds vs. Milliseconds
Most Unix timestamps are in seconds (10 digits). But JavaScript and some APIs use milliseconds (13 digits).
- Seconds:
1735689600— Unix, PHP, Python - Milliseconds:
1735689600000— JavaScript, Java
How to tell them apart: just look at the length. 10 digits = seconds. 13 digits = milliseconds.
How to Convert Timestamps
Method 1: Online Tool (Easiest)
Use our free timestamp converter. Enter a 10- or 13-digit number and get:
- Local time
- UTC time
- ISO 8601 format
- Weekday
- Elapsed time (how long ago)
You can also convert dates back to timestamps.
Method 2: JavaScript
// Timestamp to date
new Date(1735689600 * 1000).toISOString();
// Date to timestamp
Math.floor(Date.now() / 1000);
Method 3: Python
import time
from datetime import datetime
# Timestamp to date
datetime.fromtimestamp(1735689600)
# Date to timestamp
int(datetime.now().timestamp())
Method 4: PHP
// Timestamp to date
date('Y-m-d H:i:s', 1735689600);
// Date to timestamp
time();
Method 5: MySQL
-- Timestamp to date
SELECT FROM_UNIXTIME(1735689600);
-- Date to timestamp
SELECT UNIX_TIMESTAMP('2025-01-01 00:00:00');
Common Use Cases
- Database records — every
created_atfield - API responses — JSON dates are usually Unix timestamps
- JWT tokens — the
expclaim is a Unix timestamp - Cache expiry — cache records expire at a given timestamp
- Log files — server logs record events by timestamp
- Cron jobs — schedule runs by timestamp comparison
Watch Out: The Year 2038 Problem
On 32-bit systems, Unix timestamps overflow on 2038-01-19 03:14:07 UTC. After that moment, the number exceeds the maximum value a signed 32-bit integer can hold.
Modern 64-bit systems are not affected — they can represent timestamps for the next 292 billion years.
If you're working with legacy systems, this is worth knowing.
Converting in Different Timezones
A Unix timestamp itself has no timezone — it's absolute. When you convert it to a human-readable date, you choose the timezone:
- UTC — universal reference (best for storage)
- Local time — depends on user's browser or server
- Specific timezone — e.g., "New York time"
Our timestamp converter shows you both local and UTC time.
Try It Now
Use our free timestamp converter to:
- Convert a timestamp to a readable date
- Convert a date to a timestamp
- See elapsed time (how long ago)
- Auto-detect seconds vs. milliseconds
Related Tools
- JSON formatter — clean up JSON containing timestamps
- URL / Base64 encoder — handle encoded strings
Summary
- Unix timestamp = seconds since 1970-01-01 UTC
- 10 digits = seconds; 13 digits = milliseconds
- Timestamps are timezone-independent and easy to compare
- 32-bit systems hit the Year 2038 problem
- Use a converter for quick work; use code for automated tasks