Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back.
Reviewed by Aygul Dovletova · Last reviewed
How to Use the Unix Timestamp Converter
- Pick a mode. "Timestamp to Date" takes a number and returns a human-readable date; "Date to Timestamp" takes a date/time and returns an integer.
- Paste your timestamp (seconds or milliseconds). The component auto-detects precision by digit count: 10 digits is parsed as seconds, 13 digits as milliseconds. Click Convert to render local time, UTC, ISO 8601, and a relative-time label.
- Or pick a date in "Date to Timestamp" mode to see the equivalent Unix seconds and milliseconds integers. Each field has a copy button.
- Read the live counter at the top - it ticks every second so you always have the current epoch value one click away.
What Unix Time Actually Is (And Is Not)
A Unix timestamp is the number of seconds that have elapsed since 1970-01-01T00:00:00Z, ignoring leap seconds. "Ignoring leap seconds" is the single most important and most misunderstood detail. POSIX defines Unix time as (year - 1970) * 365.25 * 86400 plus day-of-year and second-of-day, with no correction for the ~27 leap seconds that UTC has absorbed since 1972. That means Unix time sometimes pauses (e.g., 23:59:60 becomes 23:59:59 a second time) or lurches forward - the exact strategy depends on the operating system's time sync daemon. Google's "leap smear" spreads the anomaly over 24 hours so nothing ever repeats. The conversion in this page reads Date.getTime(), which is the browser's already-smeared view, so you never see a 61-second minute. Parsing a timestamp is new Date(seconds * 1000); going the other way is Math.floor(date.getTime() / 1000).
When You Reach For Epoch Conversion
- Debugging a log line with a raw epoch timestamp ("why did
1699987200trigger an alert?") and wanting to know what wall-clock time that was. - Generating a cookie Expires value, a JWT iat/exp claim, or an OAuth2 token expiry - all of which are Unix seconds.
- Populating a database seed file with historical test data in
BIGINTmillisecond columns. - Reading a photo EXIF DateTimeOriginal or a filesystem mtime and translating it to a meeting-friendly date.
- Comparing two API responses that disagree on whether their timestamp is seconds, milliseconds, or microseconds.
- Calculating countdowns based on API-returned deadlines in raw seconds since epoch.
Pitfalls Every Developer Eventually Hits
- Seconds vs. milliseconds. Multiplying a ms timestamp by 1000 yields the year 52,000-something; dividing a seconds timestamp by 1000 yields 1970. The difference is always a factor of 1000 and is always silently wrong when confused. Digit-count detection (10 vs. 13) is the usual heuristic.
- Year 2038. A signed 32-bit integer overflows at
2147483647= 2038-01-19T03:14:07Z. Any system still storing Unix time inint32will wrap to December 1901 on that second. 64-bitint64systems push the overflow to year 292,277,026,596 - well past human concern. Embedded devices, old C, and some legacy file formats are the realistic risks; all mainstream languages long since moved to 64-bit time. - Year 2106. Unsigned 32-bit overflows at 2106-02-07T06:28:15Z. Some older systems used
uint32specifically to push past 2038; they have their own cliff. - Leap seconds. Unix time pretends they do not exist. The IERS added 27 of them between 1972 and 2017 (none since). The General Conference on Weights and Measures voted in 2022 to eliminate leap seconds by 2035. Until then, precise time-interval math across decades can be off by ±27 seconds.
- Negative timestamps.
-86400is 1969-12-31. Perfectly valid; some early database drivers choked on them. Modern languages handle negatives fine. Date.now()vs.performance.now(). The former is wall-clock milliseconds-since-epoch and jumps when the system clock is adjusted (NTP, DST, manual change). The latter is a monotonic high-resolution timer that never jumps but has no epoch reference. UseDate.now()for timestamps; useperformance.now()for interval timing.
Epoch Across Systems And Specs
Unix time was introduced with the first edition of Unix in 1971; POSIX formalised it (IEEE Std 1003.1). Java's System.currentTimeMillis() shares the epoch, and JavaScript's Date inherits from Java. Other epochs exist: Windows FILETIME counts 100-ns intervals since 1601-01-01; Cocoa's NSDate uses 2001-01-01 UTC; Excel's serial date counts days since 1900-01-00 with a Lotus 1-2-3 compatibility bug that treats 1900 as a leap year (day 60 is "1900-02-29," which did not exist). RFC 3339 and ISO 8601 define the human-readable form that toISOString() emits. NTP daemons discipline local Unix time against UTC from pool.ntp.org or PTP sources.
Epoch Tools Compared
Command line: date -r 1700000000 on BSD/macOS or date -d @1700000000 on GNU/Linux - fast, but you have to remember which flag each flavour wants. Python: datetime.fromtimestamp(1700000000, tz=timezone.utc) - verbose but correct. PostgreSQL: to_timestamp(1700000000). epochconverter.com is the incumbent browser tool and has been around since the late 2000s; it supports several more esoteric epoch formats (Apple Mach absolute, Windows FILETIME hex) that we omit for focus. DevTools console: new Date(1700000000 * 1000).toISOString() is one line. This page wins for a visual side-by-side of local, UTC, ISO, and relative at once, with copy buttons and a live counter, without switching contexts away from your browser. For bulk or script-level use, the shell command or jq's todate/fromdate are unbeatable.
Frequently Asked Questions
Why does the current timestamp shown here not match epochconverter.com by a second or two?
Because both pages are reading your local device clock, not a shared reference. If two tabs repaint a fraction of a second apart, they will show values one second different. Any difference greater than a few seconds points to browser throttling (background tabs), an old laptop with a drifted clock, or a CDN serving a cached HTML page with a stale initial render. The tick interval on this page is 1 Hz driven by setInterval.
What is the Year 2038 problem?
On 2038-01-19T03:14:07Z, signed 32-bit Unix timestamps overflow to -2147483648, mapping to 1901-12-13. Systems using int32 time already misbehave on forward-looking math (loan amortisation, long-lived cert expiration). The fix is int64 time, which mainstream Linux and BSD completed years ago. Worry if you maintain embedded devices, old C code, or protocols that hard-code 4-byte timestamps.
How can I tell whether a timestamp is in seconds or milliseconds?
Digit count is the signal. For any recent or near-future date, seconds are 10 digits (~1-2 billion) and milliseconds are 13 digits (~1-2 trillion). Microseconds (16 digits) and nanoseconds (19 digits) appear in lower-level APIs. A 10-digit number passed to new Date() yields year 1970-1973 - the smoke signal you need to multiply by 1000.
Does Unix time include leap seconds?
No. Unix time is "seconds since epoch, assuming every day is exactly 86,400 seconds," which is a lie by about 27 seconds since 1972. Real UTC inserts leap seconds to stay within 0.9s of Earth rotation. POSIX chose simplicity over precision. The BIPM voted in 2022 to abolish leap second insertions by 2035, at which point the divergence freezes.
Can I enter a negative number?
Yes. Negative timestamps represent moments before 1970-01-01T00:00:00Z. For example, -86400 is 1969-12-31T00:00:00Z and -2208988800 is 1900-01-01T00:00:00Z. Most modern languages handle negatives correctly; a few old database drivers (MySQL before 5.6, for instance) rejected them. If you need pre-epoch dates and your storage layer refuses negatives, use ISO 8601 strings instead.
Why does the relative-time label sometimes say "in 0 seconds"?
Intl.RelativeTimeFormat rounds to the nearest unit, and "now" is a narrow window. When the target is within half a second of the current moment, the "seconds" unit rounds to zero and you get "in 0 seconds" or "0 seconds ago" depending on sign. It is technically correct; a more polished UI might switch to "just now" below a threshold. Wait one second and the label resolves to a meaningful non-zero value.
Is the conversion done in the browser or on a server?
Entirely in the browser. The Preact island takes your input, calls new Date(seconds * 1000) or date.getTime() / 1000, formats the result with Intl.DateTimeFormat and toISOString(), and displays it. There is no fetch call, no WebSocket, no analytics of the input value. The live counter just reads Date.now() in a setInterval; nothing leaves the tab.
Does the tool show the timestamp in my local timezone or UTC?
Both, as separate rows. The "Local" row uses your browser timezone (the zone reported by Intl.DateTimeFormat().resolvedOptions().timeZone, derived from your OS settings). The "UTC" row is zone-neutral. The ISO 8601 row ends in Z, indicating UTC. If you need a third zone, use our Timezone Converter on the resulting ISO string.
What is the difference between Date.now() and performance.now()?
Date.now() returns milliseconds since Unix epoch as an integer and is what you want for timestamps. performance.now() returns milliseconds since the page was loaded, as a floating-point number with sub-millisecond resolution, and is monotonic - it never goes backwards even if the system clock is adjusted. For "how long did that operation take" use performance.now(). For "what time was that event" use Date.now(). Mixing them is a common bug in profiling code.
Can I convert a very large timestamp like 9999999999?
Yes. 9,999,999,999 seconds is 2286-11-20, well within JavaScript Date's range (upper bound year 275,760). A 20-digit nanosecond timestamp will be misread as milliseconds by default - divide by 1,000,000 first to get milliseconds, or by 1,000,000,000 for seconds.
How do I generate a JWT exp claim from this?
JWT exp (RFC 7519) expects Unix seconds as an integer. Use "Date to Timestamp" mode, pick your expiry, and copy the seconds value directly into the claim. The cookie Expires attribute formally wants RFC 2822 format, not seconds, so use Date.prototype.toUTCString() on the resulting Date for that one. Most servers accept an ISO 8601 string too, but older user agents may reject it.
More Developer Tools
Base64 Encoder & Decoder
Encode UTF-8 text to Base64 online or decode Base64 back to UTF-8 and plain text. Runs in your browser with no upload.
Open toolBulk URL Encode / Decode
Encode or decode many URLs at once. Paste a newline-separated list and the tool processes each line in parallel, preserving order and blank lines.
Open toolCode Screenshot
Create beautiful code snippet images with customizable themes.
Open toolColor Converter
Convert colors between HEX, RGB, HSL and CMYK formats.
Open toolCron Expression Parser
Parse cron expressions into human-readable schedules with next run times.
Open toolCSS Formatter / Minifier
Format, beautify and minify CSS code.
Open tool