Paste a timestamp or pick a date
From a log, a database, an API or your code.
Paste a Unix timestamp to see the date it stands for, in UTC and in your local time, or pick a date to get its timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected.
100% private — the calculation is done in your browser and nothing is sent to any server.
Guides: Unix timestamps explained: seconds, milliseconds and the year 2038 · How to read a JWT, and why decoding is not verifying
Keep going with your result in another tool. Nothing is uploaded.
From a log, a database, an API or your code.
It is detected from the length, or you can set it.
UTC, ISO 8601, your local time, RFC 2822 and how long ago it was.
A Unix timestamp is the number of seconds that have passed since midnight UTC on 1 January 1970, known as the epoch. It is how a huge amount of software stores and exchanges moments in time: databases, log files, APIs, tokens, file systems and programming languages. It is compact and unambiguous, but impossible for a person to read. This converter translates it into a date you can understand, and back.
The classic timestamp counts seconds and has 10 digits today, but many systems count in milliseconds, which gives 13 digits, and some in microseconds or nanoseconds, with 16 and 19 digits. JavaScript and Java use milliseconds, while most databases and shell tools use seconds. Getting the unit wrong gives a date in 1970 or thousands of years in the future, so the tool guesses the unit from the number of digits and you can override it. It always shows both the seconds and the milliseconds for the moment.
Switch the mode, pick a date and time, and say whether it is in your local time zone or in UTC. The tool returns the timestamp in seconds and milliseconds, ready to paste into a query or a test. The distinction between local time and UTC matters: the same wall-clock time is a different timestamp in different zones.
Timestamps before 1970 are negative numbers and work fine. Systems that store the value in a 32-bit signed integer will run out on 19 January 2038, the "year 2038 problem". This tool uses 64-bit arithmetic and is not affected, and it can show dates well beyond that.
Timestamps carry no time zone and no leap seconds, and this converter follows the same convention, in which every day has exactly 86,400 seconds. Dates before the adoption of the Gregorian calendar use the same proleptic calendar as your browser. For other date formats, see the ISO 8601 converter.
Excel and Google Sheets count days from 1900, and a Unix timestamp counts seconds from 1970, so the conversion is a division and the date of 1 January 1970. With a timestamp in seconds in A2, one in milliseconds in B2 and a date and time in C2:
| To get | Formula | Result |
|---|---|---|
| Seconds to date and time (UTC) | =A2/86400+DATE(1970, | 2023-11-14 22:13:20 |
| Milliseconds to date and time (UTC) | =B2/86400000+DATE(1970, | 2023-11-14 22:13:20 |
| The same, one hour ahead of UTC | =A2/86400+DATE(1970, | 2023-11-14 23:13:20 |
| Date and time to a timestamp in seconds | =(C2-DATE(1970, | 1700000000 |
The formulas use English function names and commas. If your Excel or Google Sheets is set to another language, the function names change, and in many countries the separator between arguments is a semicolon.
NOW() returns local time, but the formulas above give UTC. Add or subtract the offset divided by 24, as in the third row.A Unix timestamp counts seconds since 1 January 1970 UTC. Each snippet below was run and the comments show the real output for 1700000000.
from datetime import datetime, timezone print(datetime.fromtimestamp(1700000000, tz=timezone.utc).isoformat()) # 2023-11-14T22:13:20+00:00 moment = datetime(2023, 11, 14, 22, 13, 20, tzinfo=timezone.utc) print(int(moment.timestamp())) # 1700000000
console.log(new Date(1700000000 * 1000).toISOString()); // 2023-11-14T22:13:20.000Z
console.log(Math.floor(new Date("2023-11-14T22:13:20Z").getTime() / 1000)); // 1700000000
console.log(Math.floor(Date.now() / 1000)); // the current timestamp, which changes every second
date -u -r 1700000000 # macOS and BSD: Tue Nov 14 22:13:20 UTC 2023 date -u -d @1700000000 # Linux (GNU): Tue Nov 14 22:13:20 UTC 2023 date +%s # the current timestamp, on both
new Date() and divide by 1000 for the other way. A date in January 1970 usually means a timestamp in seconds was read as milliseconds.tz=timezone.utc in Python. datetime.utcfromtimestamp() still exists but has been deprecated since Python 3.12 and returns a date with no time zone attached.date commands use different options for the same job, which is why both are shown.=A2/86400+DATE(1970,1,1). Format the cell as a date and time. For millisecond timestamps divide by 86400000 instead.datetime.fromtimestamp(1700000000, tz=timezone.utc) with from datetime import datetime, timezone. Its isoformat() gives 2023-11-14T22:13:20+00:00.More utilities that also run without leaving your browser.