Logo

Current Unix timestamp

The current Unix timestamp is the number below: the count of seconds since 00:00:00 UTC on January 1, 1970, increasing by 1 every second. It is the same number everywhere on Earth at the same moment, whatever the local time zone. Turn on Show Milliseconds to see the 13-digit version that JavaScript and many APIs use, and check the line under the counter for the same moment in your local time. To turn a timestamp into a date, or a date into a timestamp, use the Unix timestamp converter.

Current Unix time
1791642422
Time in Phan Thiết:
Real-time UTC Epoch Sync

Is a Unix timestamp in seconds or milliseconds?

A standard Unix timestamp counts seconds and has 10 digits for any date between 2001 and 2286. A timestamp with 13 digits counts milliseconds, and one with 16 digits counts microseconds. They describe the same moment at different precision.

JavaScript's Date.now() returns milliseconds, while PHP's time() and the Linux date +%s command return seconds. Mixing them up is the most common bug: a millisecond value read as seconds lands tens of thousands of years in the future.

How do you get the current timestamp in code?

Every major language reads the Unix timestamp from the system clock in one line.

  • JavaScript: Math.floor(Date.now() / 1000)
  • Python: import time; int(time.time())
  • PHP: time()
  • MySQL: SELECT UNIX_TIMESTAMP();
  • Linux or macOS shell: date +%s

Background on how the count started, and why some systems will overflow in 2038, is in what Unix time is.

Round-number Unix timestamps and their dates

Round Unix numbers fall on fixed moments that developers sometimes mark. Each value below is the exact UTC time it corresponds to.

  • 1,700,000,000: November 14, 2023, 22:13:20 UTC
  • 1,800,000,000: January 15, 2027, 08:00:00 UTC
  • 2,000,000,000: May 18, 2033, 03:33:20 UTC
  • 2,147,483,647: January 19, 2038, 03:14:07 UTC, the largest value a signed 32-bit integer can hold

Frequently asked questions

Is the Unix timestamp the same in every time zone?

Yes. The timestamp counts seconds from a fixed moment in UTC, so it has the same value in Tokyo, London and Los Angeles at the same instant. Time zones only matter when the number is turned back into a local date and time.

Does Unix time count leap seconds?

No. Unix time treats every day as exactly 86,400 seconds, so the 27 leap seconds added to UTC since 1972 are not in the count. On the rare days with a leap second, systems repeat or smear one second to stay in step.

What format should I store dates in besides Unix time?

For text formats, use ISO 8601 with a time zone, such as 2027-01-15T08:00:00Z, which humans and software both read without confusion. The rules and examples are in the ISO 8601 date and time format guide.