Unix Timestamp Converter
Convert between Unix timestamps and human-readable dates instantly. Paste a timestamp in seconds or milliseconds, enter an ISO 8601 string, or grab the current time. Everything runs in your browser - nothing is sent to a server.
Try These Examples
0— The Unix epoch: 1 January 1970 00:00:00 UTC1000000000— 9 September 2001, the "billennium"2147483647— 19 January 2038, the Y2K38 32-bit overflow
How It Works
Unix time counts the number of seconds since 1 January 1970 00:00:00 UTC, often called the epoch. Because it is a single integer with no timezone component, it is the most portable way to store and transmit time values between systems.
Getting the current timestamp in JavaScript
Date.now() returns the current time as milliseconds since the epoch. To get seconds, divide by 1,000 and floor the result:
const ms = Date.now(); // 1700000000000 const sec = Math.floor(ms / 1000); // 1700000000
Converting a timestamp to a readable date
Pass milliseconds to the Date constructor, then format the result:
const d = new Date(1700000000 * 1000); d.toISOString(); // "2023-11-14T22:13:20.000Z" d.toLocaleString(); // locale-dependent string
Seconds vs. milliseconds
Most Unix command-line tools (date +%s, Python's time.time()) use seconds. JavaScript and Java use milliseconds. This tool auto-detects the unit: if the number has 13 or more digits it is treated as milliseconds; otherwise it is treated as seconds.
Frequently Asked Questions
What is a Unix timestamp?
A Unix timestamp (also called Epoch time or POSIX time) is the number of seconds that have elapsed since 1 January 1970 00:00:00 UTC. It is a simple, timezone-independent way to represent a point in time as a single integer.
How do I tell if a timestamp is in seconds or milliseconds?
Timestamps in seconds are typically 10 digits long (e.g. 1700000000), while millisecond timestamps are 13 digits (e.g. 1700000000000). JavaScript's Date.now() returns milliseconds, whereas most Unix command-line tools return seconds.
What is the Year 2038 problem?
Many older systems store Unix timestamps as a signed 32-bit integer, which can hold a maximum value of 2,147,483,647. That value corresponds to 19 January 2038 03:14:07 UTC, after which the counter overflows. Modern 64-bit systems and JavaScript are unaffected because they use larger number types.
How do I get the current Unix timestamp in JavaScript?
Use Date.now() to get the current time in milliseconds, or Math.floor(Date.now() / 1000) for seconds. You can also use new Date().getTime(), which is equivalent to Date.now().