Last reviewed:
What is a Unix timestamp?
A Unix timestamp, also called epoch time or POSIX time, is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC, a moment known as the Unix epoch. Negative values count backwards to dates before 1970. At any given instant the timestamp is the same everywhere in the world, so it needs no time zone. That makes it ideal for storing and comparing moments: sorting timestamps sorts events, and subtracting two gives a duration in seconds.
Different systems count in different units. Unix tools, most databases, JWT claims and many APIs use seconds, which is 10 digits for current dates. JavaScript's Date.now() and Java's System.currentTimeMillis() use milliseconds (13 digits). Some databases and languages use microseconds (16 digits), and Go's UnixNano and tracing systems use nanoseconds (19 digits). Reading a value in the wrong unit is the most common timestamp bug.
Unix time ignores leap seconds: every day counts as exactly 86,400 seconds. Systems that store it in a signed 32-bit integer run out of range on 19 January 2038 at 03:14:07 UTC, the so-called year 2038 problem. 64-bit timestamps do not have this limit.
How to use this tool
- The top panel shows the Current Unix time in seconds and milliseconds, updating live. Use Copy seconds or Copy ms, and Pause to freeze the clock while you copy.
- In Timestamp to date, type or paste a timestamp. Digit separators such as spaces, commas and underscores are ignored, and Now fills in the current time.
- Leave Unit on Detect automatically, or force Seconds, Milliseconds, Microseconds or Nanoseconds.
- Read the result: the unit used, the date in UTC, the date in your own time zone (named, for example
Asia/Kolkata), ISO 8601, a relative time such as "3 days ago", and the value in seconds and milliseconds. Each row has a Copy button. - In Date to timestamp, pick a date and time, choose Your time zone or UTC, and read the timestamp in seconds and milliseconds along with ISO 8601 and UTC forms.
Automatic detection treats values below 100 billion as seconds, below 100 trillion as milliseconds, below 10^17 as microseconds, and anything larger as nanoseconds.
Examples
The same instant in four units
Input Detected as ISO 8601 (UTC)
1760000000 seconds 2025-10-09T08:53:20.000Z
1760000000123 milliseconds 2025-10-09T08:53:20.123Z
1760000000123456 microseconds 2025-10-09T08:53:20.123Z
0 seconds 1970-01-01T00:00:00.000Z
The microsecond value shows the same millisecond as the line above it; JavaScript dates cannot represent anything finer than a millisecond.
Negative timestamps and the 2038 limit
-86400 1969-12-31T00:00:00.000Z one day before the epoch
2147483647 2038-01-19T03:14:07.000Z largest signed 32-bit value
2147483648 2038-01-19T03:14:08.000Z overflows a 32-bit int to -2147483648
A date to a timestamp
Choosing UTC and the date 1 January 2026, 00:00:00 gives:
Seconds 1767225600
Milliseconds 1767225600000
ISO 8601 2026-01-01T00:00:00.000Z
With Your time zone selected instead, the result shifts by your UTC offset on that date. In India (UTC+05:30) the same wall-clock time is 1767205800.
Common errors and how to fix them
- The date shows January 1970. A seconds value was read as milliseconds, often in JavaScript with
new Date(1760000000). Multiply by 1000 or let the tool detect the unit. - The date is tens of thousands of years in the future. The reverse: milliseconds read as seconds. Divide by 1000.
- The time is off by a few hours. The value is correct, but it is being displayed in a different time zone from the one you assumed. Compare the UTC row with your local row.
- Off by exactly one hour around March or October. Daylight saving time changed the local offset between the two dates you are comparing. Do date arithmetic in UTC.
- "That is not a number". The input contains letters or a date string. Paste a numeric timestamp, or use the Date to timestamp panel for dates.
- A database returns a different value. Check whether the column stores UTC (for example PostgreSQL
timestamptz) or local time without a zone (timestamp). The latter silently depends on the server's settings.
When developers use this
- Reading timestamps in log lines, database rows, message queues and analytics events while debugging.
- Checking when a JWT, cookie, cache entry or presigned URL expires.
- Writing a test fixture or SQL query that needs the timestamp for a specific date and time.
- Comparing event times from servers in different regions in a single reference zone.
- Verifying that an API returns seconds and not milliseconds before integrating with it.
- Checking whether an old system that stores 32-bit timestamps will be affected by 2038.
Privacy and how it works
All conversions use your browser's built-in Date and Intl APIs and your computer's clock and time zone settings. Nothing you enter is sent to our servers. Because the local time row depends on your operating system's time zone, the same timestamp shows a different local time for colleagues in other countries, while the UTC and ISO rows are identical everywhere.
Limitations
- Precision is limited to milliseconds, because JavaScript dates store milliseconds. Microsecond and nanosecond inputs are converted correctly but their sub-millisecond part is not shown.
- The supported range is about 271,821 BC to AD 275,760, the limit of JavaScript dates.
- Unix time does not count leap seconds, so it differs from TAI and GPS time by a number of seconds.
FAQ
How do I know if a timestamp is in seconds or milliseconds?
Count the digits. Current dates have 10 digits in seconds, 13 in milliseconds, 16 in microseconds and 19 in nanoseconds. The automatic detection in this tool works on the same principle.
Does a Unix timestamp depend on my time zone?
No. A timestamp identifies one instant, which is the same everywhere. Time zones only matter when you turn it into a calendar date and clock time for display, which is why the tool shows both UTC and your local time.
What is the year 2038 problem?
Signed 32-bit integers can hold values up to 2,147,483,647, which is 19 January 2038 at 03:14:07 UTC. One second later, systems that store time in 32 bits overflow to a negative number and jump back to 1901. Modern systems use 64-bit values.
Can timestamps be negative?
Yes. Negative values represent dates before 1 January 1970; -86400 is 31 December 1969 at midnight UTC. Not every system supports them, so test before storing historical dates as epoch values.
Why does the relative time change while I watch?
It is computed from your current clock, so "in 59 minutes" becomes "in 58 minutes". The absolute dates and the timestamp itself do not change.
How do I get the current timestamp in code?
In JavaScript use Math.floor(Date.now() / 1000) for seconds, in Python int(time.time()), in Java Instant.now().getEpochSecond(), and in a shell date +%s.
Should I store timestamps or formatted dates in my database?
Store instants in a type that represents a moment in UTC, such as timestamptz in PostgreSQL or a 64-bit epoch value. Format them for display at the edge of your application, in the user's time zone.