Inspect the header and payload of a JSON Web Token.
Unix Timestamp Converter
Convert Unix timestamps to dates and back.
Runs in your browserProcessed locally. Your input never leaves your device.
Details
About this tool
Turns a Unix timestamp into a readable date in UTC and in your own time zone, and turns a date back into a timestamp. Seconds and milliseconds are both accepted and told apart automatically.
A Unix timestamp is a count of seconds since midnight UTC on 1 January 1970 - the epoch. It is the format logs, databases, APIs and JWTs store time in, for one good reason: it is a single number with no time zone, no daylight saving and no ambiguity about whether 03/04 means March or April. The cost is that no human can read it, which is why this page exists.
The number's length tells you the unit. Ten digits is seconds and lands in the present day; thirteen is milliseconds, which is what JavaScript's Date.now() and most JVM APIs return; sixteen is microseconds, common in Python and PostgreSQL. Feeding a millisecond value into something expecting seconds is the classic bug - it puts the date in the year 56000 or thereabouts - so the tool reads the length rather than making you declare it.
The two dates shown are the same instant written twice. UTC is what the system stored; your local time is what it means where you are, daylight saving included. When you are matching a log line to a support ticket, that difference is the whole question. Timestamps before 1970 are negative, which is legal and handled, and everything runs in your browser, so a production log line stays on your machine.
Keep going
Related tools
- Runs in your browserDeveloper
-
Generate cryptographically random version 4 UUIDs in bulk.
Runs in your browserDeveloper -
Convert text to Base64 and back.
Runs in your browserDeveloper
Good to know
Questions people actually ask
- Seconds or milliseconds?
- Both are accepted and detected from the length. Ten digits is seconds, thirteen is milliseconds, sixteen is microseconds. If you are unsure which a system produced, paste it in and check that the resulting date is somewhere near today.
- What is the Unix epoch?
- Midnight UTC on 1 January 1970, the zero point Unix chose and effectively everything since inherited. A timestamp is simply the number of seconds elapsed since then, which is why the format needs no time zone attached to be unambiguous.
- What is the year 2038 problem?
- A timestamp stored as a signed 32-bit integer runs out on 19 January 2038 and wraps to 1901. Modern systems use 64 bits and are fine for longer than the sun will last, but embedded devices, old file formats and unmigrated database columns still exist. Anything storing time in four bytes is worth checking.
- Why does the local time differ from what the log shows?
- Because a timestamp has no time zone: it is one instant, and UTC and your local clock are two ways of writing it. Most servers log in UTC, so a difference of a whole number of hours - and the awkward hour of it when daylight saving is involved - is expected, not a bug.