How to use the timestamp converter
Step 1 — Grab the current epoch, or paste your own
The current Unix time ticks at the top of the tool in both seconds and milliseconds, each with its own copy button — if you only came for “the epoch right now”, take it and go. Otherwise paste your number into the first tab. You do not need to know its unit.
Step 2 — Let it detect the unit, or override it
The tool counts the digits and tells you what it decided, in plain words, above the results: 10 digits is seconds, 13 milliseconds, 16 microseconds, 19 nanoseconds. If a system you work with breaks that convention, set the unit yourself with the Read the number as menu and the tool obeys you instead.
Step 3 — Choose the zone to display it in
Type a city rather than scrolling — india, london, PST and NYC all resolve, and each suggestion shows that zone’s live local time. The result appears in fourteen forms at once: ISO 8601 in your zone and in UTC, a human sentence, RFC 2822 for email headers, all four Unix units, plus weekday, day of year, ISO week, quarter, the exact UTC offset applied and the Excel serial number.
Step 4 — Or go the other way
The second tab takes a date and a time and asks which zone that reading belongs to. This is the direction that most often goes wrong by an hour, because the same wall-clock time is a different instant depending on whether daylight saving was in force on that date. The tool shows the offset it applied so you can verify it, and returns the epoch in all four units.
Comparing two timestamps, or converting a list
Difference accepts a timestamp or a plain date in either box — you can mix them — and reports the gap in total seconds, minutes, hours and days, as a 29d 6h 13m 20s breakdown, and as a calendar span. Batch takes up to 500 lines, detects the unit line by line, marks anything invalid rather than skipping it silently, and exports the table as CSV.
Copying the conversion code
The Code snippets tab gives the conversion written out for JavaScript, Python, PHP, Java, Go, MySQL, PostgreSQL and Bash, using the timestamp you currently have loaded, plus how to get the current timestamp in each. The JavaScript snippet uses milliseconds, because passing a seconds value to new Date() is the classic epoch mistake and returns January 1970 with no error at all.
About the Unix timestamp converter
A Unix timestamp is a single number that identifies an exact moment in time — the count of seconds since 1 January 1970 at 00:00:00 UTC. This tool converts that number into a readable date in any time zone, converts a date back into a timestamp, compares two of them, processes a whole list at once, and hands you the conversion code for eight programming languages.
Epoch values turn up everywhere in software: JSON API responses, server logs, database columns, JWT expiry claims, cookie lifetimes, file metadata and cron schedules. They are stored as numbers precisely because a number carries no time zone and no formatting ambiguity — but that also makes them unreadable to a human, which is why this conversion is one of the most common small tasks in development and debugging.
What makes this one different
Most converters handle seconds and milliseconds and quietly fail on anything finer. This one detects and converts seconds, milliseconds, microseconds and nanoseconds, and parses the digits with BigInt so nothing is rounded. A nineteen-digit nanosecond timestamp passes the largest integer JavaScript can hold exactly, and converters using ordinary arithmetic either round the final digits or return an invalid date. Here, a nanosecond value round-trips back to exactly the digits you pasted.
Who this is for
- Developers debugging an API response or a database column full of epoch values.
- Sysadmins and SREs reading server logs where every line is stamped in Unix time.
- Anyone working with JWTs, checking whether a token’s
expclaim has already passed. - Data analysts converting a whole column of timestamps into something a spreadsheet can chart.
Unix time explained
What the number actually counts
A Unix timestamp, also called epoch time or POSIX time, counts seconds elapsed since the Unix epoch: 1 January 1970, 00:00:00 UTC. That instant is zero, and every timestamp is measured from it.
Its value is that it carries no time zone and no formatting. 1787472000 means one specific instant everywhere on Earth. Two servers in different countries can exchange that number with no ambiguity, whereas “23/08/2026 08:00” is a different instant in Delhi than in New York and might even be read as a different date depending on whether the reader expects day-first or month-first.
Seconds, milliseconds, microseconds and nanoseconds
The original Unix convention counts whole seconds — time() in PHP, date +%s in Bash, UNIX_TIMESTAMP() in MySQL. Other environments count finer:
| Unit | Digits today | Where you meet it |
|---|---|---|
| Seconds | 10 | PHP, Bash, MySQL, most APIs, JWT exp claims |
| Milliseconds | 13 | JavaScript Date.now(), Java currentTimeMillis() |
| Microseconds | 16 | PostgreSQL internals, tracing and profiling systems |
| Nanoseconds | 19 | Go UnixNano(), Prometheus, Elasticsearch |
Mixing them up is the most common epoch mistake there is. A seconds value passed to JavaScript’s new Date(), which expects milliseconds, silently returns a date in January 1970 rather than throwing an error — so the bug ships. A milliseconds value read as seconds lands tens of thousands of years in the future, which at least is obvious.
Why precision matters here
JavaScript cannot hold a whole number above 9,007,199,254,740,991 exactly. A nanosecond timestamp has nineteen digits and passes that limit, so a converter doing ordinary arithmetic quietly rounds the last few digits. This tool parses with BigInt and hands only a millisecond figure — always well inside the safe range — to the date object, so the digits you paste are the digits you get back.
Frequently asked questions
What is the current Unix timestamp?
It is displayed live at the top of the tool and updates every second, in seconds and milliseconds, with a copy button on each. Nothing needs converting first.
How do I know whether a timestamp is in seconds or milliseconds?
Count the digits. Between 2001 and 2033, a seconds timestamp is 10 digits and a milliseconds timestamp is 13. If unsure, paste it in — the converter states which unit it used and lets you override. A quick sanity check: a seconds value read as milliseconds lands in January 1970, and a milliseconds value read as seconds lands tens of thousands of years away.
How do I convert a Unix timestamp to a date in Excel?
Excel counts days from 30 December 1899, not seconds from 1970, so the formula is =(A1/86400)+25569 with the cell formatted as a date. This tool gives you the Excel serial number directly, which avoids the formula entirely.
How do I get the current timestamp in JavaScript, Python or PHP?
JavaScript: Math.floor(Date.now() / 1000) for seconds, Date.now() for milliseconds. Python: int(datetime.now(timezone.utc).timestamp()). PHP: time(). All eight languages are in the Code snippets tab with the reverse conversion too.
Can I convert a timestamp from before 1970?
Yes. Negative values count backwards from the epoch, so -86400 is 31 December 1969 at 00:00:00 UTC. Negative input works in every tab.
What is the Y2K38 problem?
Systems storing Unix time in a signed 32-bit integer cannot count past 2147483647, reached on 19 January 2038 at 03:14:07 UTC. The next second overflows to a negative number and the date reads as December 1901. 64-bit storage moves the ceiling to roughly 292 billion years away, but embedded systems and old database columns are still being found and fixed. The epoch reference table in the tool lists that exact value so you can test how your own system behaves at the boundary.
Does Unix time account for leap seconds?
No, and deliberately so. Unix time treats every day as exactly 86,400 seconds, which keeps arithmetic simple — subtract two timestamps and you get elapsed seconds without consulting a table. The trade-off is that it drifts from true astronomical UTC by the number of leap seconds inserted since 1972. Irrelevant for almost all software; not irrelevant for satellite tracking or precision timing.
Why does the same date give a different timestamp than I expected?
Almost always a time zone or daylight saving difference. A wall-clock reading of 08:00 is a different instant in every zone, and in zones observing daylight saving it is a different instant in summer than in winter. The Date to Timestamp tab shows the exact UTC offset it applied so you can confirm the tool used the zone you intended.
What is epoch time in a JWT token?
JWT iat, exp and nbf claims are Unix timestamps in seconds, not milliseconds — a frequent cause of tokens that expire immediately or never. Paste the claim value here to see the real expiry date and whether it has passed.
Can I convert a whole log file of timestamps?
Yes — the Batch tab takes up to 500 lines at once, detects the unit per line, and exports the results as CSV ready to open in a spreadsheet.
Is my data sent anywhere?
No. Every conversion runs inside your browser using the IANA time zone database your device already ships with. Nothing you paste — timestamps, logs or dates — is uploaded, which matters when the values come from production systems.