Skip to content

Unix timestamp converter

Convert epoch timestamps to readable dates and dates to timestamps, in UTC or your own time zone.

Current Unix timestamp

–

Timestamp to date

Seconds, milliseconds, microseconds or nanoseconds

Date to timestamp

Time zone

Code

Getting the current timestamp

LanguageSeconds since the epoch
JavaScriptMath.floor(Date.now() / 1000)
Pythonint(time.time())
PHPtime()
Gotime.Now().Unix()
JavaInstant.now().getEpochSecond()
Bashdate +%s
PostgreSQLextract(epoch from now())
MySQLUNIX_TIMESTAMP()

Timestamps and time zones

A timestamp marks one instant, the same everywhere. Time zones only matter when you turn it into a date and time for people to read: 1700000000 is 14 November 2023, 22:13:20 in UTC, but already 15 November in Tokyo. Store timestamps (or UTC times), and convert to local time only for display.

Frequently asked questions

What is a Unix timestamp?

The number of seconds since 1 January 1970 at 00:00:00 UTC, a moment called the Unix epoch. It is the same everywhere in the world at a given instant, which makes it a simple, time-zone-free way for computers to store and compare times.

Is it in seconds or milliseconds?

Unix itself counts seconds, but JavaScript’s Date.now() and many Java and web APIs use milliseconds. A current timestamp in seconds has 10 digits; in milliseconds it has 13. This converter detects the unit from the number of digits.

What is the year 2038 problem?

Systems that store Unix time as a signed 32-bit number run out on 19 January 2038 at 03:14:07 UTC, when the count passes 2,147,483,647 and wraps around to a date in 1901. Modern systems use 64-bit numbers, which last for billions of years.

Does Unix time include leap seconds?

No. Unix time pretends every day has exactly 86,400 seconds, so the leap seconds added to UTC over the years are not counted. For everyday dates, this makes no visible difference.