Timestamp Converter Online

Convert between Unix timestamps and dates.

Current Unix Timestamp
Timestamp
Date
Output

Enter a Unix timestamp in the top field and click Timestamp → Date to see the UTC, local, and ISO 8601 representations. Enter a date string in the bottom field and click Date → Timestamp to get seconds and milliseconds. Click Now to prefill the current local time.

What is a Unix timestamp?

A Unix timestamp (also called epoch time or POSIX time) is the number of seconds elapsed since January 1, 1970 at 00:00:00 UTC — known as the Unix epoch. It is the most widely used time representation in programming because it is timezone-independent, easy to store as a single integer, and simple to compare and do arithmetic with.

Example: the timestamp 1700000000 = November 14, 2023 at 22:13:20 UTC.

Seconds vs milliseconds

Most Unix APIs (C, Python, shell) use seconds. JavaScript's Date.now() and many modern APIs use milliseconds — the same moment as a milliseconds timestamp has 13 digits instead of 10. This tool auto-detects: values greater than 9,999,999,999 are treated as milliseconds.

Code examples

JavaScript
// Current timestamp
const seconds = Math.floor(Date.now() / 1000);   // e.g. 1700000000
const millis  = Date.now();                        // e.g. 1700000000000

// Timestamp → Date
const d = new Date(1700000000 * 1000);
console.log(d.toISOString());   // "2023-11-14T22:13:20.000Z"
console.log(d.toLocaleString()); // local time

// Date string → timestamp
const ts = Math.floor(new Date('2024-01-15T12:00:00Z').getTime() / 1000);
Python
import time
from datetime import datetime, timezone

# Current timestamp
ts = int(time.time())             # seconds
ts_ms = int(time.time() * 1000)  # milliseconds

# Timestamp → datetime
dt = datetime.fromtimestamp(1700000000, tz=timezone.utc)
print(dt.isoformat())  # "2023-11-14T22:13:20+00:00"

# datetime → timestamp
ts = int(datetime(2024, 1, 15, 12, 0, 0, tzinfo=timezone.utc).timestamp())

Frequently asked questions

What is the Unix epoch?
The epoch is the reference point: January 1, 1970 00:00:00 UTC, which has a timestamp of 0. All Unix timestamps are the number of seconds (or milliseconds) elapsed from this point.
How do I get the current Unix timestamp?
JavaScript: Math.floor(Date.now() / 1000) for seconds. Python: int(time.time()). Unix shell: date +%s.
Why does my timestamp show a date in 1970?
If a value in milliseconds is interpreted as seconds, it will appear near the epoch. For example, 1700000 seconds ≈ Jan 20, 1970, but 1700000000 seconds ≈ Nov 2023. Make sure you're using the right unit.
What is the Year 2038 problem?
Systems storing Unix timestamps as a signed 32-bit integer will overflow on January 19, 2038 at 03:14:07 UTC. Modern systems use 64-bit integers, which extend the safe range by billions of years.
What is ISO 8601?
ISO 8601 is an international standard for date and time strings, e.g. 2024-01-15T12:30:00Z. The Z suffix indicates UTC. It is sortable as a string and unambiguous, making it ideal for logs, APIs, and databases.

Related tools