Unix Timestamp Converter: Complete Guide to Epoch Time
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC. It is the single most common way computers store and compare dates and times in code, databases, and APIs. If you have ever seen a number like 1742380800 in a log file or API response and wondered what it means — this guide explains everything.
Why Unix Timestamps Exist
Human-readable date strings like "March 19, 2026 09:00 AM" are complicated for computers. They require parsing, timezone handling, and locale awareness. A Unix timestamp is just an integer — simple to store, sort, and compare. Subtract two timestamps and you get the elapsed seconds instantly. That is why timestamps appear in:
- Database records (
created_at,updated_atcolumns) - JWT tokens (
expandiatclaims) - HTTP cache headers (
Last-Modified,Expires) - Log files and audit trails
- File system metadata (creation/modification time)
- Cookie expiry values
Seconds vs Milliseconds
This is the most common source of confusion. Unix timestamps traditionally count seconds, but JavaScript's Date.now() returns milliseconds. A seconds-based timestamp for March 2026 is around 1742000000 (10 digits). A milliseconds-based timestamp is around 1742000000000 (13 digits). If a timestamp looks 1000× too large, you are likely looking at milliseconds when you expected seconds.
| Format | Example value | Digits |
|---|---|---|
| Unix seconds | 1742380800 | 10 |
| Unix milliseconds | 1742380800000 | 13 |
| Unix microseconds | 1742380800000000 | 16 |
Notable Unix Timestamps
| Timestamp | Date | Significance |
|---|---|---|
0 | Jan 1, 1970 00:00 UTC | The Unix epoch — the origin point |
1000000000 | Sep 9, 2001 | Unix time hit 1 billion |
1234567890 | Feb 13, 2009 | Celebrated by developers worldwide |
2147483647 | Jan 19, 2038 | Y2K38: max value for 32-bit signed int |
2000000000 | May 18, 2033 | Unix time hits 2 billion |
Systems that store Unix time as a 32-bit signed integer will overflow on January 19, 2038 at 03:14:07 UTC. Modern 64-bit systems can store timestamps hundreds of billions of years into the future, but embedded systems and legacy software may still be affected. Check that your database timestamp columns use 64-bit integers or the TIMESTAMP(6) type.
Getting the Current Timestamp in Code
JavaScript
// Milliseconds (divide by 1000 for seconds)
Date.now() // e.g. 1742380800000
Math.floor(Date.now() / 1000) // seconds: 1742380800
// From a Date object
new Date().getTime() // milliseconds
Python
import time
time.time() # seconds as float: 1742380800.123
int(time.time()) # integer seconds: 1742380800
# Using datetime
from datetime import datetime, timezone
datetime.now(timezone.utc).timestamp()
PHP
time() // current Unix timestamp in seconds
microtime(true) // with microseconds as float
SQL
-- MySQL / MariaDB
SELECT UNIX_TIMESTAMP();
SELECT UNIX_TIMESTAMP('2026-03-19 09:00:00');
-- PostgreSQL
SELECT EXTRACT(EPOCH FROM NOW());
-- SQLite
SELECT strftime('%s', 'now');
Convert Any Unix Timestamp Instantly
Paste a timestamp and get the human-readable date in your local timezone — or convert a date back to a timestamp.
Open the Timestamp ConverterConverting a Timestamp to a Readable Date
To convert 1742380800 back to a date, the tool (or your code) takes the number of seconds, adds them to January 1 1970, and applies the target timezone offset. The same timestamp will display as a different local time depending on the viewer's timezone — but it always refers to the exact same moment in time.
JavaScript example
const ts = 1742380800;
const date = new Date(ts * 1000); // multiply by 1000 for ms
console.log(date.toISOString()); // "2026-03-19T08:00:00.000Z"
console.log(date.toLocaleString()); // local timezone
Python example
from datetime import datetime, timezone
ts = 1742380800
dt = datetime.fromtimestamp(ts, tz=timezone.utc)
print(dt.isoformat()) # 2026-03-19T08:00:00+00:00
Unix Timestamps in JWT Tokens
JSON Web Tokens use Unix timestamps for two critical claims: iat (issued at) and exp (expires at). If a JWT is expiring unexpectedly or "in the past", the first thing to check is whether the server clock is in sync. An NTP drift of even a few minutes can cause token rejections. Use our JWT Decoder guide to inspect token claims directly.
How to Use the Unix Timestamp Converter Tool
- Open the Unix Timestamp Converter
- To convert a timestamp to a date: paste the number (seconds or milliseconds) into the timestamp field and click Convert
- To convert a date to a timestamp: enter the date and time, select the timezone, and the tool returns the corresponding Unix timestamp
- The result shows both UTC and your local time
Common Mistakes
- Mixing seconds and milliseconds — always check the digit count (10 = seconds, 13 = milliseconds)
- Ignoring timezone — a timestamp is always UTC internally; timezone only affects display
- Storing as 32-bit integer — will overflow in 2038; use 64-bit or BIGINT
- Negative timestamps — valid and refer to dates before 1970 (e.g.
-86400= Dec 31, 1969) - Comparing timestamps from different precision systems — always normalise to the same unit before comparing