Unix Timestamp Converter
Paste an epoch in seconds, milliseconds, microseconds or nanoseconds and see the date in your time zone, in UTC and in ISO 8601. The unit is detected from the number of digits. You can also paste a date to get its epoch.
No value yet
Paste a timestamp or a date in the field. Every format shows up here right away, each with a copy button.
Date to timestamp
Pick a date and time. The epoch is calculated in the UTC zone, the one selected above.
Convert log lines
Paste log, JSON or CSV lines. Every number with 10, 13, 16 or 19 digits becomes an ISO 8601 date in the UTC zone. The lines stay in your browser.
Did the timestamp come from a JWT exp, iat or nbf? The decoder shows the whole token and tells you whether it has expired.
Just need a date as an ISO string or UTC string? The date format converter does that in one click.
Timestamps in code
How to get the current timestamp and convert it both ways in common languages.
// Now, in seconds and in milliseconds
Math.floor(Date.now() / 1000); // 1790254800
Date.now(); // 1790254800123
// Epoch to date (Date expects milliseconds)
new Date(1790254800 * 1000).toISOString();
// Date to epoch in seconds
Math.floor(new Date("2026-09-24T10:00:00-03:00").getTime() / 1000);What is a Unix timestamp
A Unix timestamp, or epoch, is the number of seconds since January 1, 1970 at 00:00:00 UTC, not counting leap seconds. The same number stands for the same instant anywhere in the world, which is why it shows up in database columns, logs, message queues, API responses and the exp, iat and nbf claims of a JWT. The time zone only matters when a date is shown to a person.
Seconds, milliseconds, microseconds or nanoseconds
The unit isn't written in the number. For dates between 2001 and 2286 the digit count settles it: each finer unit adds 3 digits. That is how this converter detects the unit.
| Digits | Unit | Example | Where it usually shows up |
|---|---|---|---|
| 10 | Seconds | 1790254800 | PHP time(), Python int(time.time()), JWT exp, PostgreSQL EXTRACT(EPOCH), RabbitMQ timestamp property |
| 13 | Milliseconds | 1790254800000 | JavaScript Date.now(), Java System.currentTimeMillis(), Kafka record timestamp, SQS SentTimestamp |
| 16 | Microseconds | 1790254800000000 | BigQuery UNIX_MICROS, Python time.time_ns() // 1000, tracing |
| 19 | Nanoseconds | 1790254800000000000 | Go UnixNano(), Python time.time_ns(), InfluxDB and metrics |
UTC and local time
A timestamp has no time zone. Whoever displays it applies one: new Date(ms).toISOString() shows UTC, and toLocaleString() uses the browser's zone. That is why two computers in different zones show different times for the same value. When a date is off by a whole number of hours, it is almost always UTC being read as local time, or the other way around.
A date in 1970 or thousands of years ahead
Both symptoms come from the same unit mix-up. A value in seconds passed to JavaScript's new Date(), which expects milliseconds, becomes January 1970. A Date.now() stored in a field the backend reads as seconds becomes a date tens of thousands of years ahead. Converting the number here shows right away which one happened.
Daylight saving time and old dates
Time zone rules change over time. Brazil, for example, used daylight saving time until February 2019, and during those periods São Paulo was at UTC−2 instead of UTC−3. A system that converts old dates with a fixed offset gets everything that fell in summer wrong by one hour. The IANA time zone database, used here and by browsers, keeps each year's rules, and the result is flagged when the date falls in daylight saving time.
The year 2038 problem
The largest signed 32-bit integer is 2147483647, which is 2038-01-19 at 03:14:07 UTC. One second later, systems that store the epoch in 32 bits wrap around to 1901. MySQL's TIMESTAMP type has this limit. BIGINT columns and languages with 64-bit integers don't, and this converter accepts dates well past 2038.
Negative timestamps
Negative values are dates before 1970: −86400 is 1969-12-31 in UTC. Birth dates and historical records can produce them, and some older databases and libraries reject them. Worth adding one to your test data.
Start and end of the day in another zone
September 24 in São Paulo starts at 03:00 UTC, not at midnight UTC. A BETWEEN filter built with the start of the day in UTC returns rows from the wrong day. This converter's start and end table uses the zone you picked, and the end of a period is the last millisecond before the next one starts.
Unix timestamp FAQ
Units, time zones and the date bugs that show up most in logs and APIs.