Blog

How to convert Unix timestamps to dates

What epoch time is, how to tell seconds from milliseconds at a glance, and how to convert timestamps and dates in both directions.

February 7, 2026

The log line says the order failed at 1738886400. Your manager wants to know when that was, in words, preferably before the meeting starts. Here’s how to read numbers like that, and how to turn dates back into them.

What is Unix time

Unix time (also called POSIX time or epoch time) stores a moment as one number: the seconds that have passed since midnight UTC on January 1, 1970, ignoring leap seconds. That starting point is called the Unix epoch. So 1738886400 is February 7, 2025 at midnight UTC.

Why bother with a number instead of a date? It fits in one integer, it doesn’t care about timezones, and it’s easy to work with. Subtract two timestamps and you have a duration. Sort them and you’ve sorted by time. That’s why databases, log files, APIs and operating systems use it everywhere.

The epoch: January 1, 1970

The early Unix developers needed a starting point and picked a recent, round date. Moments before it are simply negative numbers. -86400 is December 31, 1969 at midnight UTC, exactly one day (86,400 seconds) earlier.

Seconds vs milliseconds

This is the mix-up that bites everyone at least once. Classic Unix timestamps count seconds and have 10 digits today. JavaScript, Java and many web APIs count milliseconds, which gives 13 digits:

Text
1738886400       seconds (Unix, Python, PHP, Ruby)
1738886400000    milliseconds (JavaScript, Java)
JavaScript
const toMs = (seconds) => seconds * 1000;
const toSeconds = (ms) => Math.floor(ms / 1000);

Get it wrong and the date is obviously off. Read seconds as milliseconds and your order was placed in January 1970. Read milliseconds as seconds and it was placed tens of thousands of years from now. If you see either, count the digits.

How to use the timestamp converter

The timestamp converter works in both directions.

Timestamp to date

  1. Paste a Unix timestamp and select Convert or press Enter. Select Now if you want the current time instead.
  2. You don’t need to say which unit it is. A value above 1,000,000,000,000 is treated as milliseconds, anything smaller as seconds.
  3. You get the date in your local time, ISO 8601 and UTC, plus the value in both seconds and milliseconds. Each row has its own copy button.

Date to timestamp

  1. Type a date such as 2025-01-15T10:30:00Z or Jan 15, 2025 10:30:00.
  2. Select Convert to get the timestamp in seconds and milliseconds.

One thing to watch: your browser’s Date object reads the text, and it guesses the timezone when you don’t give one. A Z (UTC) or an offset such as +02:00 is exact. A date and time without one, like Jan 15, 2025 10:30:00, is read as your local time. A date on its own in ISO form, like 2025-01-15, is read as midnight UTC. When it matters, add the offset.

Common timestamp formats

Here’s the same moment in the formats you’ll meet most:

FormatExample
Unix (seconds)1738886400
Unix (milliseconds)1738886400000
ISO 86012025-02-07T00:00:00.000Z
RFC 2822 (email headers)Fri, 07 Feb 2025 00:00:00 +0000
HTTP date (UTC)Fri, 07 Feb 2025 00:00:00 GMT

Working with timestamps in code

Every mainstream language can make and read timestamps:

JavaScript (milliseconds)
const now = Date.now(); // e.g. 1738886400000
const date = new Date(1738886400000);
console.log(date.toISOString()); // 2025-02-07T00:00:00.000Z
Python (seconds)
import time
from datetime import datetime, timezone

now = int(time.time())  # e.g. 1738886400
print(datetime.fromtimestamp(1738886400, tz=timezone.utc))
# 2025-02-07 00:00:00+00:00
PHP (seconds)
$now = time(); // e.g. 1738886400
echo gmdate("c", 1738886400); // 2025-02-07T00:00:00+00:00

The year 2038 problem

A signed 32-bit integer tops out at 2,147,483,647, which is 03:14:07 UTC on January 19, 2038. One second later, a system that stores time in 32 bits overflows. The number wraps around to negative, and the clock suddenly reads December 13, 1901.

Most modern systems use 64-bit timestamps, which won’t overflow for about 292 billion years, so that one is somebody else’s problem. Old embedded devices, file formats and database columns can still be caught out in 2038.

Timezones

A Unix timestamp has no timezone. It always counts from the epoch in UTC. The timezone only comes in when you turn it into a clock time, so the same timestamp is 9am in London and 4am in New York.

The safe habit: store and send timestamps (or ISO 8601 strings with an offset), and convert to local time only when you show it to someone. That’s why the converter shows both UTC and your local time.

Need data from a webpage as JSON?

PulpMiner turns any public page into structured JSON and can save it as a live API. See it work on a demo page, no sign-up.

Try it on a demo page