Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and vice versa. Auto-detects seconds vs milliseconds. Runs entirely in your browser.
Timestamp → Date
Date → Timestamp
Accepts: ISO 8601 (2024-01-15T12:00:00Z), RFC 2822, or any format JavaScript's Date can parse.
What is a Unix Timestamp?
A Unix timestamp (also called Unix time, epoch time, or POSIX time) is the number of seconds elapsed since 00:00:00 UTC on 1 January 1970 — the Unix epoch. It is a timezone-independent, language-agnostic standard for representing a precise instant in time. Unix timestamps appear in databases, REST APIs, JWT tokens, file system metadata, log files, and system clocks.
Many modern systems use millisecond timestamps — the number of milliseconds since the epoch. JavaScript's Date.now(), for example, returns milliseconds. This converter auto-detects: values greater than 10¹² are treated as milliseconds; smaller values are treated as seconds.
Notable Unix timestamps
| Timestamp | Date (UTC) | Note |
|---|---|---|
| 0 | 1970-01-01 00:00:00 | Unix epoch — time zero |
| 1000000000 | 2001-09-09 01:46:40 | Billionth second milestone |
| 1111111111 | 2005-03-18 01:58:31 | All-ones pattern |
| 1234567890 | 2009-02-13 23:31:30 | Popular milestone celebrated globally |
| 1700000000 | 2023-11-14 22:13:20 | Recent reference point |
| 2000000000 | 2033-05-18 03:33:20 | Two-billionth second |
| 2147483647 | 2038-01-19 03:14:07 | Y2K38 — max 32-bit signed integer |
| 4294967295 | 2106-02-07 06:28:15 | Max 32-bit unsigned integer |
Get the current Unix timestamp in any language
Math.floor(Date.now() / 1000)import time; int(time.time())time.Now().Unix()time()Time.now.to_iInstant.now().getEpochSecond()SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()DateTimeOffset.UtcNow.ToUnixTimeSeconds()date +%sEXTRACT(EPOCH FROM NOW())::BIGINTSeconds vs milliseconds vs microseconds
| Unit | Digits (2024) | Common in |
|---|---|---|
| Seconds | 10 digits (~1.7B) | Unix/POSIX, PHP time(), JWT exp claim |
| Milliseconds | 13 digits (~1.7T) | JavaScript Date.now(), Java System.currentTimeMillis() |
| Microseconds | 16 digits | PostgreSQL, Python time.time_ns()//1000, high-res logs |
| Nanoseconds | 19 digits | Go time.Now().UnixNano(), Rust SystemTime |
Unix timestamp vs ISO 8601
ISO 8601 (e.g., 2024-04-18T12:00:00Z) is human-readable and includes timezone information explicitly. Unix timestamps are always UTC and are simpler to compare and store as integers. APIs often accept both — ISO 8601 in request bodies, Unix timestamps in query parameters. When storing in a database, a Unix timestamp integer is faster to index and compare than a string date.
The Year 2038 problem
On 19 January 2038 at 03:14:07 UTC, 32-bit signed integers used to store Unix timestamps will overflow, rolling back to 1901-12-13. This is similar to the Y2K problem. Modern 64-bit systems are not affected — a 64-bit Unix timestamp can represent dates billions of years in the future. Legacy embedded systems, databases with 32-bit DATETIME columns, and old C code using time_t as a 32-bit type are at risk.
Frequently asked questions
How do I convert a Unix timestamp to a date in Python?▾
Use datetime.datetime.fromtimestamp(ts, tz=datetime.timezone.utc) for UTC or fromtimestamp(ts) for local time. For millisecond timestamps, divide by 1000 first: datetime.datetime.fromtimestamp(ts / 1000, tz=datetime.timezone.utc).
How do I convert a Unix timestamp to a date in JavaScript?▾
Pass the timestamp in milliseconds to the Date constructor: new Date(ts * 1000) for second timestamps, or new Date(ts) for millisecond timestamps. Then use .toUTCString(), .toISOString(), or .toLocaleString() to format.
What is the difference between Unix time and UTC?▾
UTC is a timezone — a standard for civil timekeeping. Unix time is a count of seconds since a fixed epoch, measured in UTC. Unix time does not account for leap seconds, so it is technically not identical to UTC, but the difference is negligible for most applications.
Why does my timestamp show 1970-01-01?▾
A value of 0 (or near 0) converts to the epoch date. This usually means the timestamp was not set — a field defaulted to 0 or null was coerced to a number. Check whether the source system populates the timestamp correctly.
How do I store a Unix timestamp in a database?▾
Use a BIGINT column for maximum compatibility and portability. PostgreSQL also has TIMESTAMPTZ which stores UTC internally. Avoid VARCHAR for timestamps — integer comparison is faster and avoids format mismatch bugs.
What is epoch time?▾
Epoch time and Unix time are synonymous. 'Epoch' refers to the reference point (1 January 1970 00:00:00 UTC) from which the count begins. Some systems use different epochs — Windows FILETIME counts 100-nanosecond intervals since 1601-01-01, for example.
Related Tools
If jsondecode.com saved you time, share it with your team
Free forever. No ads. No sign-up. Help other developers find it.