A Unix timestamp converter turns the raw number computers use to store time into a date a human can read, and back again. That single number — the epoch time — is everywhere once you start looking: in database rows, server logs, JWT tokens, API responses, cookies and file metadata. This unix timestamp converter is a two-way epoch converter that handles both directions instantly, detects whether your value is in seconds or milliseconds, and shows the result in UTC, your local time and ISO 8601. Everything below explains what a Unix timestamp actually is, the conventions and pitfalls around it, and how to convert timestamp values correctly in JavaScript, Python, MySQL and beyond.
What is a Unix timestamp (epoch time)?
A Unix timestamp, also called epoch time, POSIX time or Unix time, is the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC) on 1 January 1970. That exact instant is called the Unix epoch, and it is the zero point from which everything is measured. So a timestamp of 0 is the epoch itself, 86400 is exactly one day later, and a value in the region of 1.7 billion lands somewhere in the mid-2020s.
The design choice that makes epoch time so useful is that it is a single integer with no time zone, no calendar quirks and no formatting. It does not care whether your server is in Tokyo or New York; the same number is the same instant everywhere. Dates, by contrast, are messy — they involve months of different lengths, leap years, time zones and daylight-saving shifts. Storing a plain count of seconds sidesteps all of that, which is why the epoch to date conversion is one of the most common operations in programming.
Why epoch time is used in programming, databases and APIs
If a human-readable date is so much easier to read, why do computers insist on a giant number? Because that number is dramatically easier to work with. Comparing two timestamps is a simple integer comparison — the larger number is later, full stop. Calculating a duration is subtraction. Sorting log lines by time is sorting integers. None of that requires parsing “13 March” versus “03/13” or worrying about whether “10:00” means London or Los Angeles.
- Databases store created-at and updated-at columns as timestamps so rows sort and filter cheaply, and so a value means the same thing regardless of where the server lives.
- APIs return timestamps in JSON because a number is unambiguous across languages; the client formats it for the user’s zone.
- Authentication tokens such as JWTs embed epoch expiry (exp) and issued-at (iat) claims, so any server can check validity with one comparison.
- Logs and events carry timestamps so distributed systems can be stitched back into a single timeline after the fact.
The trade-off is readability, and that is exactly the gap this timestamp to date tool fills. Paste the number from a log line or an API response and you get the real date in a second, without reaching for a REPL.
Seconds vs milliseconds: the most common mistake
The single biggest source of timestamp bugs is confusing seconds with milliseconds. Classic Unix time counts whole seconds, so a current timestamp is about ten digits long. But several popular environments count milliseconds instead — JavaScript’s Date.now() and Java’s System.currentTimeMillis() both return a thirteen-digit number that is a thousand times larger.
Mix them up and the symptoms are obvious once you know them. Feed a seconds value into code that expects milliseconds and your date collapses to a point just after midnight on 1 January 1970. Do the reverse — treat milliseconds as seconds — and your date rockets tens of thousands of years into the future. This converter sidesteps the problem by auto-detecting the unit from the digit length: ten-ish digits are read as seconds, thirteen as milliseconds, and the detected unit is shown so you can confirm it. When you output a timestamp yourself, label the unit in your field name (created_at_ms) to save the next developer the guesswork.
UTC vs local time
A Unix timestamp is always anchored to UTC and carries no zone of its own. The number itself is zone-neutral; a time zone only enters the picture when you format that number into a readable date. The same timestamp shown to someone in India and someone in California is the identical instant — it just displays as different wall-clock times because their offsets from UTC differ.
That is why this tool always shows both renderings side by side: the UTC version, which is the canonical form you should store and log, and your local time, read from your browser’s own time-zone setting, which is what a user actually experiences. A classic bug is storing a date formatted in local time and then reading it back on a server in a different zone; storing the raw UTC timestamp instead makes that impossible. When you need to show a time to a user, convert from the stored UTC timestamp at the last moment, in their zone.
ISO 8601: the human-readable standard
Where a Unix timestamp is the machine-friendly form of an instant, ISO 8601 is its standardised human- and machine-readable text form. It looks like 2026-01-19T03:14:07Z — year, month and day, a T separator, then the time, with a trailing Z meaning UTC (“Zulu”). Because the fields run from largest to smallest, ISO 8601 strings sort chronologically as plain text, which makes them excellent for filenames and log lines.
ISO 8601 and epoch time describe the same instant in different clothes, and converting between them is routine. This tool emits the ISO 8601 string for any timestamp you paste, so you can copy a format that APIs, spreadsheets and databases all understand. If you are also assembling structured metadata for your pages, the JSON-LD schema generator uses ISO 8601 for date fields like datePublished, so the two formats show up together often.
How to convert a timestamp in JavaScript
JavaScript works in milliseconds, which is the detail to keep in mind. To get the current time as a classic seconds timestamp, take Date.now() and divide by 1000:
// Current Unix timestamp in seconds
const now = Math.floor(Date.now() / 1000);
// Epoch (seconds) -> Date (remember to multiply by 1000)
const d = new Date(1700000000 * 1000);
console.log(d.toISOString()); // 2023-11-14T22:13:20.000Z
// Date -> Unix timestamp (seconds)
const ts = Math.floor(new Date('2026-01-19T03:14:07Z').getTime() / 1000);The * 1000 and / 1000 steps are where seconds-vs-milliseconds bugs creep in, so it is worth a quick sanity check against the live converter above whenever a date looks wrong.
How to convert a timestamp in Python
Python’s standard library works in seconds (as a float), which maps cleanly onto classic Unix time. The time and datetime modules cover both directions:
import time
from datetime import datetime, timezone
now = int(time.time()) # current epoch seconds
# Epoch -> date (UTC)
dt = datetime.fromtimestamp(1700000000, tz=timezone.utc)
# Date -> epoch
ts = int(datetime(2026, 1, 19, 3, 14, 7,
tzinfo=timezone.utc).timestamp())Always pass tz=timezone.utc when you want UTC; without it, fromtimestamp uses the machine’s local zone, which is a frequent cause of off-by-hours surprises.
How to convert a timestamp in MySQL and other databases
Databases ship with first-class functions for epoch conversion. In MySQL, UNIX_TIMESTAMP() returns the current epoch seconds and FROM_UNIXTIME(ts) turns a timestamp back into a datetime:
-- MySQL
SELECT UNIX_TIMESTAMP(); -- current epoch seconds
SELECT FROM_UNIXTIME(1700000000); -- -> 2023-11-14 22:13:20
-- PostgreSQL
SELECT EXTRACT(EPOCH FROM now()); -- current epoch
SELECT to_timestamp(1700000000); -- epoch -> timestamptzPostgreSQL uses EXTRACT(EPOCH FROM ...) and to_timestamp(). The key habit across every database is to store timestamps in UTC and convert for display only at the edge, so your data stays portable between regions and servers.
The Year 2038 problem
The Year 2038 problem is the epoch world’s version of Y2K. Older systems store the timestamp in a signed 32-bit integer, which can hold a maximum value of 2,147,483,647. That many seconds after the epoch lands at exactly 03:14:07 UTC on 19 January 2038. One second later the integer overflows, wraps around to its most negative value, and the date flips back to December 1901.
The consequences range from harmless to serious depending on the system — anything doing date arithmetic past 2038 on a 32-bit time field is at risk. The fix is straightforward: use a 64-bit integer for time, which pushes the overflow roughly 292 billion years into the future. Most modern operating systems, languages and databases already made this move years ago, so the practical risk now sits with legacy embedded devices and old binary file formats that are expensive to update. If you maintain long-lived systems, 2038 is worth auditing the same way 2000 once was.
Leap seconds and why epoch time ignores them
Here is a subtlety that trips up precision-minded engineers: Unix time does not count leap seconds. A leap second is an extra second occasionally added to UTC to keep atomic clocks in step with the Earth’s slightly irregular rotation. Strictly speaking, that means a Unix timestamp is not a true count of every physical second that has elapsed since 1970 — it is a count of “nominal” seconds that pretends every day is exactly 86,400 seconds long.
In practice this is a feature, not a bug. Because Unix time assumes uniform days, converting between a timestamp and a calendar date is simple arithmetic with no leap-second lookup table required. The downside is that during a leap second, the same timestamp can technically represent two moments, and systems handle that by “smearing” the extra second across a window. For almost every application — logs, tokens, scheduling, analytics — the difference is irrelevant, which is why epoch time deliberately looks the other way.
It helps to keep the hierarchy straight: physical time is measured by atomic clocks (TAI), UTC adds occasional leap seconds to stay roughly aligned with the planet’s rotation, and Unix time then flattens UTC into a tidy, leap-second-free count of seconds. Each layer trades a little physical accuracy for a lot of practical convenience. Unless you are building GPS hardware, financial-exchange sequencing or scientific instrumentation, the Unix layer is exactly the right level of abstraction to work at, and this converter treats it that way.
Common uses for an epoch converter
Once you have a reliable epoch time converter at hand, it becomes part of everyday debugging. The situations it comes up in most:
- Reading logs: a log line stamped 1760000000 means nothing at a glance — paste it to see exactly when the event fired.
- Debugging APIs: responses and webhooks commonly return epoch fields; convert them to confirm a token’s expiry or an event’s real time.
- Checking token validity: decode a JWT’s exp claim to see whether it has already expired.
- Writing tests: grab the current unix timestamp from the live clock to seed fixtures or freeze time in a test.
- Scheduling: work out the epoch value for a future date so a cron job or a cache TTL fires when you intend.
Because this unix time converter runs entirely in the browser, you can paste values from private logs and internal systems without anything being uploaded — useful when the timestamps you are debugging come from production data. The relative-time readout (“2 hours ago”, “in 3 days”) is handy here too: when you are skimming a long log, a human phrase tells you at a glance whether an event is recent or ancient without doing the subtraction in your head.
Privacy: why in-browser conversion matters
Every conversion on this page happens locally in your browser using JavaScript and your device’s own clock. Nothing you type — no timestamp, no date — is sent to a server, stored or logged. That matters more than it first appears, because the timestamps developers convert are often pulled straight from production logs, authentication tokens and internal databases that should never touch a third-party service.
In-browser conversion removes that exposure entirely. You can work offline, close the tab, and leave no trace behind. It is the same privacy-first approach behind the rest of the toolkit, including the word counter and the full set of free SEO and developer tools — genuinely useful utilities that never ask you to upload your data. Paste a timestamp into the converter above and the real date appears the instant you do, no round-trip required.