Unix Timestamp Converter

Convert epoch time to a human-readable date, or any date back to a Unix timestamp. Seconds, milliseconds, and microseconds are detected automatically. 100% in-browser, no signup.

⏱ UnixLi — Live Tool All processing local · No data sent
—
unix seconds · now

Epoch ↔ Date Converter

// Paste Unix seconds, milliseconds, microseconds, ISO 8601, RFC 2822, or a human date. Auto-detected instantly.

What a Unix timestamp is

A Unix timestamp, also called epoch time or POSIX time, is the number of seconds that have passed since January 1, 1970 at 00:00:00 UTC. Because it is one integer with no timezone attached, it is the most common way for servers, databases, APIs, and log files to record “when”. The value 1715429912 means Saturday, May 11, 2024 at 12:18:32 UTC on every machine in the world. For the history of the epoch, leap seconds, and why 1970 was chosen, read epoch time explained.

This converter works in both directions and runs entirely in your browser. Paste a value and it detects the format, then shows UTC, Unix seconds, Unix milliseconds, ISO 8601, SQL format, your local time, RFC 2822, relative time, and the day of the week. Every row has a copy button, and a shareable link reopens the same timestamp later. Nothing you paste leaves the tab.

Epoch to date

To turn a Unix timestamp into a readable date, paste it into the field above. The tool interprets 10-digit numbers as seconds and formats the result in UTC first, which is the unambiguous reading, then in your local timezone. In code, the conversion is one line in most languages. The only thing to watch is the unit your language expects: JavaScript’s Date uses milliseconds, while Python, PHP, Go, and Rust constructors take seconds.

JavaScript
new Date(1715429912 * 1000).toISOString(); // "2024-05-11T12:18:32.000Z"

Date to epoch

Going the other way, paste a date string. The converter accepts ISO 8601 (2024-05-11T12:18:32Z), date-only values (2024-05-11, read as midnight UTC), RFC 2822 (Sat, 11 May 2024 12:18:32 GMT), and most human-readable dates your browser can parse. The “Unix seconds” row is the epoch value to put in your database or API call. Always include a timezone designator (Z or an offset such as +02:00) in date strings. Without one, the same text can map to different epoch values on different machines.

JavaScript
Math.floor(Date.parse('2024-05-11T12:18:32Z') / 1000); // 1715429912

Seconds, milliseconds, or microseconds?

Different systems count at different resolutions, and mixing them up is the most common timestamp bug. The converter detects the unit from the digit count:

DigitsUnitExampleTypical source
10Seconds1715429912Unix APIs, JWT claims, PostgreSQL EXTRACT(EPOCH …)
13Milliseconds1715429912000JavaScript Date.now(), Java, many JSON APIs
16Microseconds1715429912000000Some databases, tracing and logging systems

If a converted date lands in January 1970, you probably treated seconds as milliseconds. If it lands tens of thousands of years in the future, you probably treated milliseconds as seconds. The tool shows a warning when a result looks implausible. The seconds vs milliseconds guide covers this in depth.

UTC vs local time

A Unix timestamp has no timezone; UTC is simply the reference its count starts from. Local time appears only when you display a timestamp. The converter shows both: the UTC row is the same for everyone, and the “Local (browser)” row uses your device’s timezone. For example, 1715429912 is 12:18:32 UTC, 13:18:32 in Casablanca, 14:18:32 in Paris, and 08:18:32 in New York. Store and compare in Unix seconds or UTC, and convert at the edge. To see the current moment in 13 cities at once, open the timezone converter.

Negative timestamps and dates before 1970

Unix time extends backwards: negative values count seconds before the epoch. -86400 is December 31, 1969 at 00:00:00 UTC, and -14182940 is July 20, 1969 at 20:17:40 UTC, the Apollo 11 lunar landing. JavaScript, Python, PHP, Go, and Rust (chrono) all handle negative values. Some older systems, unsigned columns, and a few platform APIs do not, so test historical dates before relying on them. The converter above is built for present-day values, so run pre-1970 timestamps through the language examples below.

The Year 2038 problem

Systems that store Unix time in a signed 32-bit integer can count only up to 2147483647, which is Tuesday, January 19, 2038 at 03:14:07 UTC. One second later the value wraps to a negative number and reads as December 1901. Modern operating systems, languages, and databases use 64-bit time, which pushes the limit billions of years out. Embedded devices, old file formats, and legacy database columns (such as MySQL TIMESTAMP) still need attention. Paste 2147483647 above to see the boundary.

Unix timestamp code snippets by language

Each language has a dedicated page with a live converter, a snippet generator, and a guide to its common pitfalls:

LanguageCurrent Unix secondsEpoch → dateGuide
JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000)JavaScript timestamps
Pythonint(time.time())datetime.fromtimestamp(ts, tz=timezone.utc)Python timestamps
PHPtime()new DateTimeImmutable('@' . $ts)PHP timestamps
Gotime.Now().Unix()time.Unix(ts, 0).UTC()Go timestamps
RustSystemTime::now().duration_since(UNIX_EPOCH)DateTime::from_timestamp(ts, 0)Rust timestamps
PostgreSQLEXTRACT(EPOCH FROM now())to_timestamp(ts)PostgreSQL guide

Longer tutorials: Unix timestamps in JavaScript and timestamp to date in Python.

More timestamp tools

Frequently asked questions

What is a Unix timestamp?

A Unix timestamp is the number of seconds since January 1, 1970 at 00:00:00 UTC, known as the Unix epoch. It is a single integer that identifies the same moment in every timezone.

How do I convert a Unix timestamp to a date?

Paste it into the converter above. In code, multiply by 1000 in JavaScript (new Date(ts * 1000)) or use datetime.fromtimestamp(ts, tz=timezone.utc) in Python. 1715429912 is Saturday, May 11, 2024 at 12:18:32 UTC.

How do I convert a date to a Unix timestamp?

Paste an ISO 8601 date such as 2024-05-11T12:18:32Z into the converter and read the Unix seconds row. In JavaScript, use Math.floor(Date.parse(iso) / 1000).

How can I tell seconds from milliseconds?

Present-day Unix seconds have 10 digits and milliseconds have 13. The converter also recognizes 16-digit microseconds and warns when a result looks implausible.

Is a Unix timestamp in UTC or local time?

Unix time is defined relative to UTC and carries no timezone. Local time only appears when you format the value for display. The converter shows both UTC and your browser’s local time.

Can Unix timestamps be negative?

Yes. Negative values count backwards from 1970, so -86400 is December 31, 1969 at 00:00:00 UTC. Most modern languages support them, but check older databases and APIs.

What is the Year 2038 problem?

Signed 32-bit integers overflow after 2147483647, which is January 19, 2038 at 03:14:07 UTC. Systems that store Unix time in 64-bit integers are not affected.

Does this converter send my data to a server?

No. Every conversion runs locally in your browser tab. Timestamps and dates you paste are never uploaded or logged.

Related tools