Unix Timestamp Converter

Bidirectional: Unix epoch seconds or milliseconds to a date, or a date to a Unix timestamp.

Unix Timestamp → Date

Date → Unix Timestamp

How Unix timestamp conversion works

Converting from a Unix timestamp to a date is simple addition — the timestamp is the number of seconds (or milliseconds) since the epoch, so adding that many seconds to 1 January 1970 UTC gives the corresponding date and time. Converting the other direction subtracts the epoch from the given date and time to get the elapsed seconds count. Because a Unix timestamp is timezone-agnostic by definition, both directions here also let you specify a display or input timezone, since the same timestamp corresponds to a different local wall-clock time depending on where you are.

The most common practical mistake is mixing up seconds and milliseconds — a 13-digit millisecond timestamp fed into a function expecting seconds will land more than 30,000 years in the future. This tool's unit selector avoids that trap by asking explicitly. For converting a date between other common formats besides Unix time, see the Date Format Converter, and for calculating the duration between two dates rather than a single timestamp, see the Date Difference Calculator.

Frequently asked questions

What is a Unix timestamp?
The number of seconds (or milliseconds) that have elapsed since 00:00:00 UTC on 1 January 1970 (the "Unix epoch") — the standard way computers represent a point in time internally.
Why do some timestamps have 10 digits and others 13?
10-digit timestamps are in seconds, 13-digit timestamps are in milliseconds (seconds x 1000) — a common source of off-by-1000x bugs. Use the unit selector to tell the converter which one you have.
What timezone is the converted date shown in?
Always shown in UTC, plus in your chosen timezone if you set one — useful since a Unix timestamp itself has no timezone, it's just a count of seconds.
What is the Unix epoch?
The Unix epoch is 00:00:00 UTC on 1 January 1970 — the fixed reference point from which Unix timestamps count elapsed seconds. It was chosen somewhat arbitrarily by early Unix developers and has remained the universal standard ever since.
Why do systems use Unix timestamps?
A single integer count of seconds is simple to store, compare, and do arithmetic on — no timezone, calendar, or daylight-saving-time logic is needed to determine which of two timestamps is earlier. Nearly every programming language and database can represent and manipulate them natively.
What is the year 2038 problem?
Systems that store Unix timestamps as a signed 32-bit integer will overflow at 03:14:07 UTC on 19 January 2038, wrapping around to a negative number that represents a date in 1901. Most modern systems have moved to 64-bit timestamps, which won't overflow for billions of years, but some older or embedded systems remain vulnerable.
How do I get the current Unix timestamp in code?
In JavaScript: `Date.now()` (milliseconds) or `Math.floor(Date.now() / 1000)` (seconds). In Python: `import time; int(time.time())`. In bash: `date +%s`. In SQL (PostgreSQL): `EXTRACT(EPOCH FROM NOW())::BIGINT`. All return seconds since the Unix epoch unless otherwise noted.

Related calculators