Unix timestamp converter

Convert Unix timestamps to human-readable dates and times, or convert any date and time back to a Unix timestamp. Supports both seconds and milliseconds. Shows the current timestamp live.

Current Unix timestamp
seconds
milliseconds

Timestamp → Date

Date → Timestamp

What is a Unix timestamp?

A Unix timestamp is a way of representing a specific moment in time as a single integer — the number of seconds that have elapsed since the Unix epoch, which is defined as midnight on 1 January 1970 in Coordinated Universal Time (UTC). For example, the timestamp 1700000000 represents 14 November 2023 at 22:13:20 UTC. Negative timestamps represent moments before 1970.

Unix time is also called POSIX time, epoch time, or Unix epoch time. It was created in the early days of Unix operating systems as a simple, language-neutral, timezone-neutral way to represent absolute moments in time. Because it is a single integer, it is trivial to store, compare, sort, and perform arithmetic on time values. Adding 86400 to any Unix timestamp gives you exactly the same time the following day. Subtracting two timestamps gives you the exact elapsed seconds between them.

Seconds vs milliseconds

The original Unix timestamp is measured in seconds. As computers became faster and applications needed finer time resolution, millisecond-precision timestamps became common. JavaScript's Date.now() returns milliseconds. Java's System.currentTimeMillis() returns milliseconds. Most modern databases and APIs that need sub-second precision use milliseconds. Some systems — particularly in finance and networking — use microsecond or nanosecond precision.

A seconds timestamp is 10 digits (currently around 1,700,000,000). A milliseconds timestamp is 13 digits (the seconds value multiplied by 1000). If you receive a timestamp and are unsure whether it is seconds or milliseconds, check its magnitude — if it is 13 digits, it is almost certainly milliseconds.

The year 2038 problem

On 32-bit systems, Unix time is stored as a signed 32-bit integer, which can hold values up to 2,147,483,647. This maximum value corresponds to 19 January 2038 at 03:14:07 UTC. On that date, 32-bit systems storing Unix time will overflow and wrap around to a large negative number, potentially causing software failures. This is known as the Year 2038 problem or Y2K38. Modern 64-bit systems are immune — a signed 64-bit integer can represent timestamps well past the year 292 billion.

Unix timestamps in programming

Nearly every programming language and framework provides built-in support for Unix timestamps. In JavaScript, Date.now() returns the current millisecond timestamp, and Math.floor(Date.now()/1000) gives seconds. In Python, import time; time.time() returns the current seconds timestamp as a float. In databases, PostgreSQL's EXTRACT(EPOCH FROM now()) returns the current seconds timestamp. MySQL's UNIX_TIMESTAMP() does the same. Unix timestamps stored in database columns are typically indexed efficiently and enable fast range queries.

Timezones and UTC

Unix timestamps are always in UTC — they have no timezone information baked in. A timestamp of 1700000000 means the same absolute moment in time regardless of where in the world you are. The local time display you see depends on your browser's timezone setting. When storing timestamps in databases, always store UTC and convert to local time only at the display layer. This avoids daylight saving time bugs and timezone conversion errors that plague applications that store local times.

What is the Unix epoch? +
The Unix epoch is the reference point from which all Unix timestamps are measured: midnight (00:00:00) on 1 January 1970 in Coordinated Universal Time (UTC). A Unix timestamp of 0 corresponds to exactly this moment. All positive timestamps represent moments after this date; negative timestamps represent moments before it.
How do I get the current Unix timestamp in my code? +
JavaScript: Math.floor(Date.now()/1000) for seconds, Date.now() for milliseconds. Python: import time; int(time.time()). PHP: time(). Java: System.currentTimeMillis()/1000L. Go: time.Now().Unix(). Ruby: Time.now.to_i. Most languages have equivalent built-in functions.
Why does my timestamp show the wrong date? +
The most common cause is a seconds/milliseconds mismatch. If a seconds timestamp is treated as milliseconds, the resulting date will be in 1970. If a milliseconds timestamp is treated as seconds, the date will be far in the future. Check that you are using the correct precision for your timestamp.
What is ISO 8601? +
ISO 8601 is an international standard for representing dates and times as strings, in the format YYYY-MM-DDTHH:mm:ssZ (e.g., 2023-11-14T22:13:20Z). The Z suffix indicates UTC. ISO 8601 is the recommended format for storing and exchanging dates in APIs and databases because it is unambiguous, sortable as a string, and internationally recognised.
Is Unix time the same as UTC? +
Unix timestamps measure elapsed seconds since the UTC epoch, so they are effectively in UTC. However, Unix time does not account for leap seconds — it assumes every day has exactly 86,400 seconds. UTC does insert occasional leap seconds to keep it synchronised with astronomical time. In practice, this difference is negligible for most applications.