What Is a Unix Timestamp (Epoch Time)? A Plain Guide

If you have ever looked at a log file, an API response or a database and seen a date written as a long number like 1723334400, you have met a Unix timestamp. It is one of the most common ways computers store time, and once you understand the idea, converting it to a human date (and back) is simple. This guide explains what epoch time is, why systems use it, and the one gotcha to watch.

What a Unix timestamp is

A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since a fixed starting point: midnight UTC on 1 January 1970, known as the “epoch”. So a timestamp of 0 is that exact moment, and every second since then adds 1. A timestamp of 1723334400 simply means “1,723,334,400 seconds after the start of 1970”, which works out to a specific date and time in 2024.

Why systems use it

Storing time as a single number solves a lot of problems. It is unambiguous, no worrying about day-first versus month-first date formats, or which language the month name is in. It is timezone-neutral, the count is always in UTC, so you convert to a local zone only when displaying it. And it makes arithmetic trivial: to find the gap between two times, you subtract one number from the other. For logs, databases and APIs that just need to record and compare moments, it is ideal.

The seconds-versus-milliseconds gotcha

The single most common mistake with epoch time is the unit. There are two conventions:

Unit Example Used by
Seconds 1723334400 Unix, most databases, PHP
Milliseconds 1723334400000 JavaScript, many APIs

A milliseconds timestamp is 1000x larger, three extra digits. If a date comes out as 1970 or as some year in the far future, you have almost certainly mixed up seconds and milliseconds. The quick check: a current seconds timestamp is 10 digits; a milliseconds one is 13.

Where you will encounter timestamps

Epoch time is everywhere once you notice it: server and access logs stamp each entry with one; API responses often return created_at or updated_at as a timestamp; databases store datetimes this way under the hood; and cookies and tokens use them for expiry. For anyone doing technical SEO or debugging, being able to read a timestamp at a glance, or convert one quickly, saves constant friction when reading logs and API output.

Converting in both directions

Two conversions cover almost every need. Going from a timestamp to a human date answers “when did this log entry happen?”. Going from a date to a timestamp lets you, say, work out the epoch value for a cut-off date to filter records. In both directions the key is to be clear about timezone (the timestamp itself is UTC; you choose the zone for display) and about units (seconds or milliseconds). Get those two things right and the conversion is exact every time. It is worth remembering that the timestamp carries no timezone of its own, so two people converting the same number will see different local times, both correct, which is a feature, not a bug.

Convert a Unix timestamp instantly

You do not need to do the arithmetic. Our free Unix timestamp converter turns a timestamp into a readable date and a date into a timestamp, handling both seconds and milliseconds and showing the result in UTC and your local time. It runs in your browser, so it is instant and private. Working with other machine formats too? Our JSON formatter helps you read the API responses those timestamps usually live in.

The takeaway

A Unix timestamp is the number of seconds since 1 January 1970 UTC, a compact, unambiguous, timezone-neutral way for systems to store and compare time. The main pitfall is units: seconds (10 digits) versus milliseconds (13 digits); mixing them up sends dates to 1970 or the far future. Convert timestamps in either direction with our Unix timestamp converter, and explore the rest of our free SEO tools.

Questions? Chat with us