Timestamp or date Seconds

Accepts: Unix seconds (10-digit integer), milliseconds (13-digit integer), or any date string — e.g. 2024-05-20, May 20 2024, 2024-05-20T10:30:00Z

Unrecognized format. Try a 10-digit timestamp (e.g. 1716220800) or a date like 2024-05-20.
Presets:
Unix (seconds)
Standard POSIX epoch in seconds
Unix (milliseconds)
Used by JavaScript's Date.now()
Relative Time
How far this date is from right now
ISO 8601 (UTC)
International standard — timezone safe
ISO 8601 (Local)
ISO 8601 adjusted to your browser timezone
RFC 2822
Email & HTTP header date format
UTC Date & Time
Coordinated Universal Time
Local Date & Time
Your browser's local timezone
Day / Week Info
Day of week · ISO week number · day of year

What Is a Unix Timestamp?

A Unix timestamp is the number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC — a fixed moment known as the Unix Epoch. It is always in Coordinated Universal Time (UTC), so it stays consistent regardless of where in the world a server is located.

For example, the timestamp 1716220800 always means May 20, 2024 at 08:00:00 UTC — whether it's read in New York, London, or Tokyo. This makes Unix timestamps the universal language for storing and comparing dates in software.

Unix Epoch
0
Jan 1, 1970 — 00:00:00 UTC (Thursday)
Y2K
946684800
Jan 1, 2000 — 00:00:00 UTC (Saturday)
Unix Max (Y2K38)
2147483647
Jan 19, 2038 — max 32-bit signed integer
JS MAX_SAFE_INTEGER
9007199254740991
Largest exact integer in JavaScript (64-bit)

Seconds vs. Milliseconds

Two variants of Unix timestamps are in common use:

  • Seconds — 10-digit integer (e.g. 1716220800). Used by Unix/Linux, POSIX APIs, Python's time.time(), PHP's time(), and most backend databases.
  • Milliseconds — 13-digit integer (e.g. 1716220800000). Used by JavaScript's Date.now(), Java's System.currentTimeMillis(), and most browser and mobile APIs.

This converter auto-detects the unit: a 10-digit integer is treated as seconds; 12+ digits as milliseconds.

How to Convert Timestamps in Code

JavaScript

// Timestamp (seconds) → Date const date = new Date(1716220800 * 1000); date.toISOString(); // "2024-05-20T08:00:00.000Z" // Current time → Unix seconds const ts = Math.floor(Date.now() / 1000);

Python

from datetime import datetime, timezone # Timestamp → Date (UTC) dt = datetime.fromtimestamp(1716220800, tz=timezone.utc) print(dt) # 2024-05-20 08:00:00+00:00 # Current time → Unix seconds ts = int(datetime.now(timezone.utc).timestamp())

PHP

// Timestamp → Date string echo date('Y-m-d H:i:s', 1716220800); // 2024-05-20 08:00:00 // Date string → Timestamp echo strtotime('2024-05-20 08:00:00'); // 1716220800

SQL (PostgreSQL)

-- Timestamp → Date SELECT to_timestamp(1716220800); -- Current time → Unix seconds SELECT EXTRACT(EPOCH FROM NOW())::bigint;

The Year 2038 Problem (Y2K38)

Many legacy systems store Unix timestamps as a 32-bit signed integer. The maximum value for a 32-bit signed integer is 2,147,483,647, which corresponds to January 19, 2038 at 03:14:07 UTC. One second after that, the integer rolls over to a large negative number — causing date calculations to break on affected systems.

Modern systems use 64-bit integers, which pushes the overflow point to roughly the year 292 billion. Most current Linux kernels, databases, and programming languages are already safe.

ISO 8601 vs. RFC 2822

ISO 8601

The international standard for date/time strings. The UTC form ends in Z: 2024-05-20T08:00:00.000Z. The local form includes an offset: 2024-05-20T13:00:00+05:00. ISO 8601 strings sort lexicographically (alphabetically = chronologically), making them ideal for filenames, database keys, and APIs.

RFC 2822

Used in email Date: headers, HTTP Date headers, and RSS/Atom feeds. Example: Mon, 20 May 2024 08:00:00 +0000. More human-readable than ISO 8601 but more verbose. Use ISO 8601 for data interchange and RFC 2822 only when a specific protocol requires it.