Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path
Unix Time Converter
A Unix timestamp converter. Paste an epoch value (seconds or milliseconds — auto-detected) to get the human-readable date in both UTC and your local timezone, or pick a date to get the timestamp back. Shows the ISO 8601 string, relative time, and the current epoch ticking live. Runs entirely in your browser.
Timestamp → date
Reading as seconds (auto)
- UTC
- Tue, 14 Nov 2023 22:13:20 GMT
- Local
- Wednesday, November 15, 2023 at 3:43:20 AM GMT+5:30
- ISO 8601
- 2023-11-14T22:13:20.000Z
- Relative
- 2 years ago
Date → timestamp
- Epoch seconds
- 1699980180
- Epoch milliseconds
- 1699980180000
Computers agree on time by counting from one agreed moment. That moment is the Unix epoch, 1970-01-01T00:00:00Z, and a Unix timestamp is the number of seconds since then. Paste one and the tool renders it four ways, pick a date and it gives the timestamp back, and a clock at the top shows the current epoch in seconds and milliseconds, updated every second.
What it computes
The input must be a whole number, negative for instants before 1970. The tool decides the unit, then builds a JavaScript Date, which counts milliseconds since the epoch:
unit = milliseconds if 12 or more digits, else seconds
ms = seconds × 1000, or the value itself
UTC = HTTP-date format, e.g. Tue, 14 Nov 2023 22:13:20 GMT
ISO 8601 = YYYY-MM-DDTHH:mm:ss.sssZ, always in UTC
Local = full date and long time, your locale and time zone
Relative = floor(|ms − now| ÷ unit size), largest unit that fits
date → epoch = floor(picked local time in ms ÷ 1000)
The s and ms buttons override the automatic guess. Relative time uses fixed unit sizes, a 365-day year and a 30-day month, then days, hours, minutes and seconds, and it reports only the largest whole unit. As in POSIX time, every day is exactly 86,400 seconds, so leap seconds do not exist in this arithmetic.
A worked example
The default timestamp is 1700000000.
- It has 10 digits, fewer than 12, so it is read as seconds:
1700000000 × 1000 = 1700000000000ms. - At 86,400 seconds a day that is 19,675 whole days after 1 January 1970, which lands on 14 November 2023, plus 80,000 seconds, which is 22:13:20.
- The four rows render that instant:
| Row | Output |
|---|---|
| UTC | Tue, 14 Nov 2023 22:13:20 GMT |
| ISO 8601 | 2023-11-14T22:13:20.000Z |
| Local, New York, US English | Tuesday, November 14, 2023 at 5:13:20 PM EST |
| Relative, October 2026 | 2 years ago |
The local row depends on your device: the same instant is 3:43:20 AM on 15 November in India. The relative row depends on the clock: in October 2026 the gap is about 1,072 days, two whole 365-day years, and from 13 November 2026 it reads 3 years ago.
The reverse field starts at 2023-11-14T22:13, read as local time. In a UTC zone that gives 1699999980, 20 seconds before the default timestamp because the picker drops seconds. In New York, five hours behind UTC, the same wall-clock time is 1700017980.
Assumptions and limits
- Whole numbers only. A fractional timestamp such as
1700000000.5, or one with separators, is rejected. - The 12-digit rule. Seconds values of 12 or more digits, after the year 5138, and millisecond values of 11 or fewer, before 3 March 1973, are misread unless you force the unit. Microsecond and nanosecond timestamps, 16 and 19 digits today, need dividing by 1,000 or 1,000,000 first.
- No leap seconds. The 27 leap seconds added since 1972 are not counted, so the value is not an exact tally of elapsed SI seconds.
- Range. JavaScript dates reach about 273,000 years either side of 1970; beyond that nothing is shown.
- Local means this device. The local row and the date picker use your browser’s time zone and daylight-saving rules.
How to use the result
- Spot the 1,000-times bug. A date in January 1970 or tens of thousands of years ahead means the value was read in the wrong unit.
- Check token and cache expiry. JWT
exp,iatandnbfclaims are seconds. Paste one to see when a token expires and compare it with the live epoch. - Store UTC, display local. Keep the epoch value or an ISO 8601 string ending in
Zin databases, logs and APIs, and convert to local time only for people. - Reuse the UTC row in HTTP headers. It is the date format of headers such as
Last-ModifiedandExpires. - Mind 2038. A field that holds seconds in a signed 32-bit integer overflows after
2147483647, which is 2038-01-19T03:14:07Z.
How it works
- Auto-detects seconds vs milliseconds: 12 or more digits reads as milliseconds.
- Renders UTC, local time, ISO 8601 and relative time ("2 years ago").
- Converts a picked local date back to epoch seconds and milliseconds.
- Shows the current epoch ticking live; all in-browser.
Frequently asked questions
What is a Unix timestamp?
A Unix timestamp, or epoch time, is the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC, not counting leap seconds. It is a single number with no time zone attached that identifies one instant, which is why systems store and exchange time this way and convert to a local, human format only for display. For example, 1700000000 is 2023-11-14T22:13:20Z, and negative values count backward to instants before 1970.
Seconds or milliseconds: how does the tool know?
By the number of digits. A seconds timestamp for a current date has 10 digits, about 1.7 billion, while the same instant in milliseconds has 13 digits, about 1.7 trillion. The converter reads any value with 12 or more digits as milliseconds and anything shorter as seconds, and the s and ms buttons override the guess. JavaScript, Java and many web APIs use milliseconds, while Unix tools, JWT claims and most system calls use seconds, so mixing them up is a classic 1,000-times bug.
Why show both UTC and local time?
The timestamp itself is an absolute instant with no time zone. UTC is the unambiguous rendering, the one to use in logs, APIs and when comparing events across regions. Local time is what a person in your time zone experiences, offset from UTC and shifted by daylight saving time, and this tool formats it with your browser locale and zone. Seeing both side by side prevents the common mistake of reading a UTC log line as if it were local time, or the reverse.
How do I convert a date to a Unix timestamp?
Pick a date and time in the date to timestamp field and the tool shows the epoch in seconds and milliseconds. The picker reads your choice in your device time zone, so the same wall-clock time gives different timestamps in different places: 2023-11-14 22:13 is 1699999980 in a UTC zone and 1700017980 in New York, five hours behind. The picker works to the minute, so the seconds part of the result is always zero.
Do Unix timestamps count leap seconds?
No. POSIX time treats every day as exactly 86,400 seconds, so the 27 leap seconds added to UTC since 1972 are not counted, and the timestamp is slightly smaller than the true number of elapsed seconds. During a leap second, systems either repeat a timestamp or smear the extra second across many hours. JavaScript dates follow the same rule. International timekeeping bodies have decided to stop adding leap seconds by 2035, which will retire the problem.
What is the 2038 problem?
Systems that store the timestamp as a signed 32-bit integer can only count to 2,147,483,647 seconds, which is reached at 03:14:07 UTC on 19 January 2038. One second later the counter overflows to a negative number and dates wrap back to December 1901. Modern systems use 64-bit timestamps, which push the limit about 292 billion years out, but legacy 32-bit code, file formats and database columns remain a real migration concern, the same shape of bug as Y2K.