What is a Unix timestamp?
A Unix timestamp is a single number that counts the seconds since midnight on 1 January 1970, UTC — the “epoch” that nearly every computer system uses as its zero point. Right now that number is about 1.76 billion and it grows by one every second. Databases store it, APIs return it, log files are full of it, and programmers meet it daily — usually in the form of a ten-digit number that means nothing until it is converted into a date a human can read.
There are four common precisions, and confusing them is the classic mistake: seconds (ten digits, like 1764912000), milliseconds (thirteen digits, like 1764912000000), microseconds (sixteen digits) and nanoseconds (nineteen digits). JavaScript’s Date.now() returns milliseconds; most databases and APIs return seconds; Python’s time.time() returns seconds with a decimal fraction; high-resolution timers and databases like CockroachDB use microseconds or nanoseconds. Feed milliseconds into a tool expecting seconds and you land in the year 55,000. Feed seconds into one expecting milliseconds and you land in January 1970. This converter detects the precision from the number of digits — no unit to pick — and always shows all four, so the mix-up is visible immediately.
A timestamp has no timezone of its own — it is a single instant, the same everywhere on Earth. Timezones only appear when the number is displayed as a date: the same instant is 3 p.m. in London and 10 a.m. in New York. That is why this tool shows every result twice, in UTC and in your own local time, and why converting a date back to a timestamp depends on which timezone the date was written in.
How to convert a timestamp
- Paste the timestamp into the box. Ten digits is seconds, thirteen is milliseconds, sixteen is microseconds, nineteen is nanoseconds — the unit is detected from the length, so you do not have to pick it. If you know the unit for sure, you can still force it in the Unit menu.
- Pick a timezone if you need one. The result always shows UTC and your local time; the “Show the time in” menu adds a third reading for any city — New York, London, Shanghai, Tokyo and more — with daylight saving handled automatically. Changing it re-renders the result instantly.
- Click “Convert to date”. The headline is the relative time (“3 hours ago”, “in 2 days”), followed by the UTC date, your local date, the time in the city you picked, the timestamp in seconds, milliseconds, microseconds and nanoseconds, and the ISO 8601 string.
- To go the other way, pick a date and time and click “Convert to timestamp”. The date is read in the timezone you selected, so “2026-12-05 09:00” in Shanghai and in London give different timestamps — as they should. Or paste an ISO 8601 string such as
2026-12-05T09:00:00Zand convert that instead. - Copy any result with the Copy button next to it. The current time is shown live at the top and updates every second.
- Converting a list? Open “Convert a batch”, paste one timestamp per line and click “Convert all”. Each line is auto-detected by length, so the list can mix seconds and milliseconds freely. You get a table with the UTC date, local date, ISO string and relative time for each one; a line that is not a valid timestamp is shown as an error row and the rest still convert. Copy the table as CSV or download it as a
.csvfile for a spreadsheet.
Blank lines are ignored, so you can paste a column straight from a spreadsheet or a log file without cleaning it up first.
Three everyday uses
1. Reading a log file or database row
Something happened at 1764912000 and you need to know when. Paste it in and the answer is immediate: the UTC time, your local time, and “how long ago” in plain words. That last one is the useful one in an incident — “2 hours ago” tells you more in a crisis than a raw date does. The same works in reverse: a user reports “it broke yesterday at 4 p.m.”, convert that to a timestamp, and you can search the logs for the exact second.
2. Building and testing APIs
APIs pass timestamps everywhere: created_at, expires_at, last_seen. When a token expires “in 3600 seconds”, you need the absolute time it stops working. When a test needs a date in the past, you need the timestamp for it. This converter is the scratchpad for both directions, and the ISO 8601 output is the format most APIs accept when you send a date back.
3. Scheduling across timezones
A timestamp is the only sane way to agree on a moment with someone in another timezone: it means the same instant everywhere. Convert a meeting time to a timestamp and send the number; the recipient converts it back in their own timezone and there is no “was that 3 p.m. your time or mine?” confusion. The UTC and local display side by side make the offset visible instead of guessed.
Common mistakes to avoid
- Mixing seconds and milliseconds. Ten digits is seconds, thirteen is milliseconds. If your date lands in 1970, you fed seconds to something expecting milliseconds. If it lands in the year 55,000, it is the other way round.
- Forgetting the timezone. A timestamp is timezone-free, but a date is not. “2026-12-05 09:00” means a different instant in London than in Tokyo. Always check whether the tool is showing UTC or your local time — this one shows both, labelled.
- Trusting 32-bit timestamps after 2038. A signed 32-bit integer runs out on 19 January 2038. Modern systems use 64-bit, but old embedded devices and file formats still do not. A timestamp near 2,147,483,647 is a warning sign.
- Comparing timestamps as strings. As strings, “999999999” sorts after “1764912000” because “9” is bigger than “1”. Compare them as numbers, or you will sort your data wrong.
- Assuming midnight means the same day everywhere. Midnight UTC is still the previous evening in New York. Daily reports, billing cut-offs and “today” filters all break on this if the timezone is not explicit.
Get the current timestamp in your code
Every language has a one-liner for “now” as a Unix timestamp. The trap is the same as in the converter: know which unit your language returns.
| Language | Current timestamp | Unit |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | Seconds (Date.now() alone is milliseconds) |
| Python | int(time.time()) | Seconds |
| PHP | time() | Seconds |
| Go | time.Now().Unix() | Seconds (UnixMilli() / UnixMicro() for finer) |
| Java | Instant.now().getEpochSecond() | Seconds (System.currentTimeMillis() is milliseconds) |
| Bash | date +%s | Seconds (date +%s%N for nanoseconds) |
Paste any of these numbers back into the converter to check what instant they actually mean — if the date lands in 1970 or the year 55,000, the unit was wrong, not the number.
Frequently asked questions
- What is a Unix timestamp, in one sentence?
- The number of seconds since midnight on 1 January 1970, UTC. It is how computers store a moment in time as a single number.
- Why does the same timestamp show two different times?
- Because the timestamp is one instant, and clocks differ by timezone. 12:00 UTC is 07:00 in New York and 21:00 in Tokyo — same moment, different wall-clock reading.
- Seconds or milliseconds — which should I use?
- Match whatever your system uses. JavaScript uses milliseconds; most APIs, databases and Python use seconds. This tool converts between them, plus microseconds and nanoseconds: the same instant is 1,764,912,000 seconds, 1,764,912,000,000 milliseconds, 1,764,912,000,000,000 microseconds and 1,764,912,000,000,000,000 nanoseconds.
- What about microseconds and nanoseconds?
- Some systems count finer than milliseconds: 16 digits is microseconds, 19 digits is nanoseconds. Paste either and the converter detects it from the length — no setting to change — and shows the same instant in seconds, milliseconds, microseconds and nanoseconds side by side.
- Can I see the time in another timezone?
- Yes. Use the “Show the time in” menu to pick a city — New York, London, Shanghai, Tokyo and more. The result adds a third line for that city, with daylight saving handled automatically, and converting a date back to a timestamp reads the date in the city you picked.
- Can I paste an ISO 8601 date?
- Yes. Paste a string like
2026-12-05T09:00:00Zinto the ISO 8601 box and click “Convert ISO to timestamp”. A trailingZmeans UTC; an offset like+08:00is honoured too. - What is the maximum timestamp?
- For 64-bit systems, effectively unlimited. For old 32-bit systems, 2,147,483,647 seconds — 19 January 2038 at 03:14:07 UTC — after which the counter wraps around to 1901. That is the “Year 2038 problem”.
- Can I use this offline?
- Yes. All conversion is done by your browser’s date functions. Load the page once and it keeps working without a connection.
Privacy
Timestamps and dates are converted locally in your browser. Nothing is sent to a server, logged, or stored.
Worked example: the token that expired “early”
A user reports that their login token stopped working “an hour early”. The token’s expires_at is 1796457600. Paste it into the converter: that is 2026-12-05 08:00 UTC, which is 03:00 in New York and 16:00 in Shanghai. The user is in Shanghai and expected the token to last until 17:00 local time — but the server issued it for 08:00 UTC, which is 16:00 Shanghai time. Nothing expired early; the token was issued in UTC and read in local time. The converter’s side-by-side UTC and local display exists precisely for this bug, which is one of the most common in all of software: two people, one instant, two clocks.
The same check works in reverse. A log line says an error happened at “2026-12-05 16:00” with no timezone attached. Convert 16:00 Shanghai time and 16:00 UTC separately and you get two timestamps eight hours apart; search the logs for both and the error appears under one of them. If the log itself stores timestamps, there is no ambiguity at all — which is why every log format worth using stores UTC timestamps and converts only at display time.
Landmark timestamps worth knowing
| Timestamp | What it is |
|---|---|
| 0 | 1 January 1970, 00:00 UTC — the epoch itself |
| 1,000,000,000 | 9 September 2001 — the “billion second” party |
| 1,700,000,000 | 14 November 2023 |
| 2,147,483,647 | 19 January 2038 — the 32-bit limit |
| 4,102,444,800 | 1 January 2100 — safely beyond 32-bit range |
If you ever see a timestamp of 0 in a database, it usually means “no date was ever set”, not “1 January 1970”. And if you see a timestamp in the far future — the year 2100 or beyond — someone probably stored milliseconds where seconds were expected, and the real date is a thousand times smaller.
Share this tool
Copy the link below and paste it anywhere — a chat message, an email, a document. Whoever opens it gets the same free tool, with no account and nothing to install.