Unix Timestamp Converter

Convert Unix timestamps to human-readable dates or dates to timestamps. Supports both seconds and milliseconds formats.

Unable to find edge function with uuid: e6d4f8a0-1b5c-6d7e-c9f0-a1b2c3d4e5f6

What is a Unix timestamp?

A Unix timestamp (or epoch time) is the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC. This moment is known as the Unix Epoch.

1704067200 = Monday, January 1, 2024, 00:00:00 UTC

Unix timestamps are widely used because they’re:

  • Timezone-independent - A timestamp represents the same moment everywhere
  • Easy to compare - Simple integer comparison
  • Compact - Just a number, no formatting

Seconds vs milliseconds

Unix timestamps traditionally use seconds (10 digits):

1704067200

JavaScript timestamps use milliseconds (13 digits):

1704067200000

This tool auto-detects which format you’re using based on the number of digits.

The Year 2038 problem

32-bit systems store Unix timestamps as signed integers, which will overflow on January 19, 2038, at 03:14:07 UTC. The timestamp will wrap around to negative values, potentially causing widespread issues.

Maximum 32-bit signed: 2147483647 = 2038-01-19 03:14:07

Modern 64-bit systems don’t have this limitation, but legacy systems and embedded devices may be affected.

Working with timestamps in code

JavaScript:

// Current timestamp (milliseconds)
Date.now(); // 1704067200000

// Current timestamp (seconds)
Math.floor(Date.now() / 1000); // 1704067200

// Timestamp to date
new Date(1704067200 * 1000);

// Date to timestamp
new Date('2024-01-01').getTime() / 1000;

Python:

import time
from datetime import datetime

# Current timestamp
time.time()  # 1704067200.123

# Timestamp to date
datetime.fromtimestamp(1704067200)

# Date to timestamp
datetime(2024, 1, 1).timestamp()

PHP:

// Current timestamp
time();

// Timestamp to date
date('Y-m-d H:i:s', 1704067200);

// Date to timestamp
strtotime('2024-01-01');

Common timestamp values

TimestampDate
01970-01-01 00:00:00 (Unix Epoch)
10000000002001-09-09 01:46:40
12345678902009-02-13 23:31:30
15000000002017-07-14 02:40:00
20000000002033-05-18 03:33:20
21474836472038-01-19 03:14:07 (32-bit limit)

Timestamps in APIs and databases

JSON APIs often use timestamps for dates because they’re unambiguous:

{
  "created_at": 1704067200,
  "expires_at": 1704153600
}

Databases may store timestamps as integers or dedicated datetime types:

-- Integer storage
SELECT * FROM sessions WHERE expires_at > UNIX_TIMESTAMP();

-- MySQL datetime
SELECT * FROM sessions WHERE expires_at > NOW();

How this tool works

Enter a Unix timestamp to convert it to a human-readable date, or select a date and time to get its timestamp. The tool shows both seconds and milliseconds formats, ISO 8601, and relative time. Powered by a QuantCDN Edge Function.