🕐 Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back. Supports seconds/ms, timezones, bulk conversion, and a live "Now" clock.
▸ Bulk Convert (one timestamp per line)
How to Use
Enter a timestamp or date
Type a Unix timestamp (seconds or milliseconds) in the first field, or pick a date/time. The tool auto-detects seconds vs milliseconds.
Select your timezone
Choose UTC, your browser's local timezone, or any named timezone from the dropdown. All output formats update instantly.
Copy any format
Click Copy next to any output row — Unix seconds, milliseconds, ISO 8601, localized date, or relative time.
Frequently Asked Questions
Complete Guide: Unix Timestamp Converter
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC. It is the foundation of time representation in virtually every programming language, database, operating system, and API. Understanding timestamps — and converting them accurately — is a daily necessity for any developer working with logs, databases, scheduled jobs, or APIs.
Why Unix Timestamps?
Before epoch time became standard, systems used incompatible date formats. A Unix timestamp solves three problems simultaneously: it is timezone-agnostic (always UTC under the hood), arithmetic-friendly (subtract two timestamps to get the duration in seconds), and universally comparable across systems and languages. A timestamp of 1714694400 means exactly the same instant on a Linux server in Berlin, an iOS app in Tokyo, and a PostgreSQL database in São Paulo.
Seconds vs Milliseconds
There are two common Unix timestamp formats:
- Seconds (10 digits) — the standard Unix format, e.g.
1714694400. Used by most Unix/Linux APIs, shell date command, Python'stime.time(), and database types like PostgreSQLTIMESTAMPTZ. - Milliseconds (13 digits) — used by JavaScript's
Date.now()and many web APIs. Multiply seconds × 1000 or divide milliseconds ÷ 1000 to convert.
This tool auto-detects which you've entered based on the number of digits. A value greater than 9,999,999,999 is treated as milliseconds.
Code Examples
// JavaScript — current timestamp in seconds
const tsSeconds = Math.floor(Date.now() / 1000); // 1714694400
const tsMillis = Date.now(); // 1714694400000
// JavaScript — timestamp to Date object
const d = new Date(1714694400 * 1000);
console.log(d.toISOString()); // "2024-05-03T00:00:00.000Z"
// JavaScript — date string to timestamp
const ts = Math.floor(new Date('2024-05-03').getTime() / 1000);
// Python — current timestamp
import time
ts = int(time.time()) # seconds since epoch
# Python — timestamp to datetime (UTC)
from datetime import datetime, timezone
dt = datetime.fromtimestamp(1714694400, tz=timezone.utc)
print(dt.isoformat()) # 2024-05-03T00:00:00+00:00
# Python — datetime to timestamp
ts = int(dt.timestamp())
// PHP — current timestamp
$ts = time(); // seconds
$ts_ms = round(microtime(true) * 1000); // milliseconds
// PHP — timestamp to formatted date
$formatted = date('Y-m-d H:i:s', 1714694400); // "2024-05-03 00:00:00"
// SQL — PostgreSQL
SELECT to_timestamp(1714694400);
SELECT extract(epoch from now())::bigint;
-- MySQL
SELECT FROM_UNIXTIME(1714694400);
SELECT UNIX_TIMESTAMP(NOW());
Timezone Handling
A Unix timestamp always represents an exact UTC moment. The confusion arises when displaying it — the same timestamp shows different clock times in different timezones. When converting for display:
- Store timestamps in UTC in your database. Never store local time.
- Convert to local time only at display time, using the user's browser timezone or an explicit timezone setting.
- Use
Intl.DateTimeFormatin JavaScript for correct locale-aware formatting with proper DST handling.
The Year 2038 Problem (Y2K38)
32-bit signed integers overflow at 2147483647 — which corresponds to January 19, 2038, 03:14:07 UTC. Systems storing timestamps in 32-bit integers will wrap around to negative values at that point. Modern 64-bit systems and most databases have already migrated to 64-bit integers, which can represent times billions of years into the future. If you're working with legacy embedded systems, check whether timestamps are stored as int32.
Common Mistakes
- Mixing seconds and milliseconds — the most common bug. Always document your timestamp unit. A date in 2554 usually means someone passed seconds where milliseconds were expected.
- Local time in the database — storing
new Date().toString()instead ofDate.now()creates timezone-dependent data that breaks when users travel or servers move regions. - Date comparison without normalization — comparing ISO strings directly as text fails when formats differ (with/without milliseconds, with/without timezone suffix).
For cron scheduling with timestamps, see Cron Visualizer. For generating mock data with timestamps, see Mock JSON Generator.