Time & Date
Unix Timestamp Guide: Convert and Read Epoch Time
Published 2026-08-15 · 8 min read
TL;DR: A Unix timestamp is the number of seconds since 1970-01-01 00:00:00 UTC; convert one with the Unix Timestamp Converter or a one-line command, and check the 2038 limit on 32-bit systems.
A Unix timestamp is a single integer that says exactly when something happened: the number of seconds between 1970-01-01 00:00:00 UTC and that moment. Every log line, every API response and every database row with a created-at column is probably using it. It is small, it sorts correctly and it is timezone-free, which is why it appears everywhere, and also why a few details - the unit, the 2038 limit, the UTC anchor - are worth knowing cold. The definition and history are documented in the Unix time article.
What exactly is a Unix timestamp?
Start the clock at the epoch, the instant 1970-01-01 00:00:00 UTC, and count every elapsed second. The result is the timestamp. A value like 1784203200 names a specific second in August 2026, and the same number means the same second whether you are in Tokyo, London or New York, because the count never switches to a local clock. The anchor is explained in detail in the guide to epoch time.
How do you convert a timestamp to a date?
Two lines of code in any language turn the number into a calendar date. JavaScript works in milliseconds, so multiply by 1000 first; Python works in seconds and needs an explicit UTC timezone to avoid a local-clock surprise:
// JavaScript - timestamps here are in milliseconds
new Date(1784203200 * 1000).toISOString();
// "2026-08-15T12:00:00.000Z"
# Python - seconds, with an explicit UTC timezone
import datetime
datetime.datetime.fromtimestamp(1784203200, datetime.timezone.utc)
# datetime.datetime(2026, 8, 15, 12, 0)The fastest no-code path is the Unix Timestamp Converter, which takes a number and shows the UTC and local readings, and the Timestamp Generator does the reverse, turning a picked date back into a number.
How do you get the current timestamp?
Math.floor(Date.now() / 1000); // JS, seconds
int(time.time()) # Python, secondsNote the units again: Date.now() returns milliseconds, so the floor division by 1000 is not optional. The standard convention in most APIs, databases and logs is seconds, so convert at the boundary and store seconds unless your system explicitly standardized on milliseconds.
What is the year 2038 problem?
A signed 32-bit integer cannot count past 2,147,483,647, which is exactly 2038-01-19 03:14:07 UTC. Systems still storing timestamps in 32-bit integers will overflow one second later, producing a negative value that reads as 1901. Databases, operating systems and embedded devices that moved to 64-bit integers are safe; anything still on 32-bit is a ticking clock. The fix is the same one that solved the year 2000 problem: store larger integers or use a wider type at the boundary.
What about milliseconds and nanoseconds?
Not every timestamp counts seconds. JavaScript uses milliseconds by default, some databases and filesystems use microseconds, and nanosecond precision shows up in event-sourced systems. When a value looks wrong by a factor of 1000, that is the diagnosis: divide by the scale to recover seconds. The number of digits is the tell, and tools such as the Unix Timestamp Converter accept all three scales and label them.
Why do timestamps not include a timezone?
Because a timestamp is an instant, not a wall-clock reading. 1784203200 is the same second everywhere, so no zone belongs to it. A timezone only appears when you render the number as a human-readable date - the same instant is 08:00 in New York and 21:00 in Tokyo. Store the timestamp, format at the edges, and let the viewer timezone do the rest. This is the same reasoning behind the Z in ISO 8601, which is the text form of the same instant.
What are the common timestamp mistakes?
- Forgetting that JavaScript is milliseconds, so a seconds value read directly makes a date in 1970.
- Converting to a local timezone on the server and storing that, which doubles offsets for users elsewhere.
- Assuming two timestamps a second apart are equal because they look similar.
- Using 32-bit integers in new code and inheriting the 2038 limit by accident.
Keep the rule simple: count seconds, store the number, and convert to a readable form only where a human needs to see it.
Related Tools
Related Guides
Epoch Time Explained: The Epoch, UTC and the Year 2038 Problem
Epoch time counts seconds since 1970-01-01 00:00:00 UTC. Learn why the epoch exists, why it is timezone-free, and how the 2038 problem works.
ISO 8601 Date Format Explained: What It Looks Like and How to Use It
ISO 8601 is the international date and time format, written like 2026-08-15T14:30:00Z. Learn how to read it, why the order matters and which form to store.
Frequently Asked Questions
What is a Unix timestamp in simple terms?
It is a single number: how many seconds have passed since 1970-01-01 00:00:00 UTC. Because the count is anchored to UTC, the number means the same instant everywhere on Earth, with no timezone attached.
Is a Unix timestamp the same as epoch time?
Yes. Unix time, POSIX time and epoch time all mean the seconds since the epoch, which is 1970-01-01 00:00:00 UTC. Some systems count milliseconds or nanoseconds instead, and the size of the number tells you which unit is in use.
How do you convert a Unix timestamp to a date?
Paste the number into the Unix Timestamp Converter, or in code call new Date(seconds * 1000) in JavaScript and datetime.fromtimestamp(seconds, tz=timezone.utc) in Python. Both give you a readable calendar date and time.
What happens in the year 2038?
A 32-bit signed integer runs out of room at 2,147,483,647 seconds, which is 2038-01-19 03:14:07 UTC. Systems still counting in 32-bit integers overflow past that instant, which is the year 2038 problem.
Why does my timestamp end in 000?
It is almost certainly in milliseconds, which is the default in JavaScript and in many APIs. Divide by 1000 to get seconds, or divide by 1,000,000 for nanoseconds. The scale is the most common source of timestamp confusion.