Unix Timestamp Converter

Convert between Unix timestamps and human-readable dates

Loading...

Time Unit Reference

Unit Seconds
1 minute 60
1 hour 3,600
1 day 86,400
1 week 604,800
30 days 2,592,000
365 days 31,536,000
Event Timestamp
Unix Epoch 0
1 Billion (Sep 2001) 1,000,000,000
1.5 Billion (Jul 2017) 1,500,000,000
2 Billion (May 2033) 2,000,000,000
Y2038 (32-bit max) 2,147,483,647
3 Billion (Jan 2065) 3,000,000,000

Get Current Unix Timestamp in Code

JavaScript / TypeScript

Math.floor(Date.now() / 1000)  // seconds
Date.now()                      // milliseconds

Python

import time
int(time.time())                # seconds

PHP

time()                          // seconds
microtime(true)                 // with microseconds

Go

time.Now().Unix()               // seconds
time.Now().UnixMilli()          // milliseconds

Ruby

Time.now.to_i                   # seconds
Time.now.to_f                   # with fractional

Java / Kotlin

System.currentTimeMillis() / 1000 // seconds
Instant.now().getEpochSecond()    // Java 8+

C# / .NET

DateTimeOffset.UtcNow.ToUnixTimeSeconds()
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()

Rust

SystemTime::now()
  .duration_since(UNIX_EPOCH)?.as_secs()

Swift

Int(Date().timeIntervalSince1970) // seconds

Bash / Shell

date +%s                        # GNU/Linux
date -j +%s                     # macOS

SQL (PostgreSQL)

SELECT EXTRACT(EPOCH FROM NOW())
SELECT NOW()::timestamp

SQL (MySQL)

SELECT UNIX_TIMESTAMP()
SELECT FROM_UNIXTIME(1713024000)

What Is Unix Time?

Unix time (also called Epoch time, POSIX time, or Unix timestamp) is a system for tracking time as a running total of seconds since the Unix epoch — January 1, 1970, 00:00:00 UTC. It was introduced with the Unix operating system at Bell Labs in the late 1960s and has since become the most widely used time representation in computing.

The key advantage of Unix timestamps is their universality: they represent the same absolute moment in time regardless of time zone or locale. A timestamp of 1713024000 always means April 14, 2024, 00:00:00 UTC — whether you're reading it in New York, London, or Tokyo. This makes them ideal for storing timestamps in databases, synchronizing distributed systems, and transmitting time values across networks.

Unix time deliberately ignores leap seconds: every day is treated as exactly 86,400 seconds. This simplifies computation at the cost of occasional drift from UTC. In practice, the difference is negligible — fewer than 30 seconds have been accumulated since 1972 when leap seconds were introduced. Most applications never need to account for this discrepancy.

The most significant limitation of Unix time was the Year 2038 problem. Early implementations stored timestamps as 32-bit signed integers, which can only represent values up to 2,147,483,647 — corresponding to January 19, 2038, 03:14:07 UTC. After this point, the value overflows and wraps to a large negative number. Modern systems have largely migrated to 64-bit integers, which extend the range to approximately 292 billion years in each direction.

Frequently Asked Questions

What is a Unix timestamp?

A Unix timestamp is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC (the "Unix epoch"). It represents a point in time as a single integer, independent of time zones. For example, timestamp 0 is midnight on January 1, 1970 UTC, and 1000000000 is September 9, 2001 at 01:46:40 UTC.

How do I tell if a timestamp is in seconds or milliseconds?

Count the digits. A 10-digit number is seconds (e.g., 1713024000). A 13-digit number is milliseconds (e.g., 1713024000000). JavaScript's Date.now() returns milliseconds, while most server-side languages (Python, PHP, Go, Ruby) return seconds. Our converter auto-detects the format.

What is the Y2038 problem?

Systems using 32-bit signed integers for Unix timestamps can only represent times up to January 19, 2038, 03:14:07 UTC (timestamp 2,147,483,647). After this, the integer overflows and wraps to a negative number. Modern 64-bit systems avoid this entirely — a 64-bit timestamp can represent dates for about 292 billion years.

Does Unix time handle leap seconds?

No. Unix time treats every day as exactly 86,400 seconds, ignoring leap seconds entirely. When a leap second is inserted into UTC, Unix time effectively repeats a second rather than acknowledging it. The accumulated difference is less than 30 seconds since 1972 — negligible for most applications.

Why does Unix time start on January 1, 1970?

The date was chosen during the development of the Unix operating system at Bell Labs in the late 1960s. It was a round number (start of a new decade) recent enough to be useful, and a 32-bit integer could cover enough future time to be practical. The original epoch was actually January 1, 1971, but was later changed to 1970 for consistency.

Can Unix timestamps be negative?

Yes. Negative Unix timestamps represent dates before January 1, 1970. For example, -86400 represents December 31, 1969. Most programming languages and our converter support negative timestamps correctly.