curly{bits}

Free developer tools. Nothing leaves your browser.

curlybits / Unix Timestamp

Unix Timestamp Converter

Convert between Unix time and human-readable dates in both directions. Paste a timestamp in seconds, milliseconds, microseconds or nanoseconds (the unit is detected for you) and see it in UTC, your time zone or any other. Or pick a date to get its timestamp.

Current Unix timestamp
Milliseconds
UTC (ISO 8601)
Timestamp → date
Date → timestamp
All conversions run in your browser using its built-in time zone database.

How to use the Unix Timestamp Converter

  1. The current Unix timestamp updates live at the top. Click Copy to grab it.
  2. Paste a timestamp under Timestamp → date. The unit is detected from its length, or choose it yourself.
  3. Pick a time zone to see the local date there, plus ISO 8601 and relative time.
  4. Under Date → timestamp, choose a date, time and time zone to get the Unix timestamp.

What is a Unix timestamp?

Unix time (also called epoch time or POSIX time) counts the seconds since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. It's the same number everywhere in the world at a given moment, which is why databases, APIs and log files use it. Time zones only matter when you turn it into a calendar date.

Seconds, milliseconds or more?

  • 10 digits (e.g. 1791720000): seconds, used by Unix, PHP, Python's time.time() and most APIs.
  • 13 digits: milliseconds, used by JavaScript's Date.now() and Java.
  • 16 digits: microseconds; 19 digits: nanoseconds, used by Go and some databases.

Get the current timestamp in code

JavaScriptMath.floor(Date.now() / 1000)
Pythonint(time.time())
PHPtime()
JavaInstant.now().getEpochSecond()
Gotime.Now().Unix()
MySQLSELECT UNIX_TIMESTAMP();
PostgreSQLSELECT extract(epoch FROM now());
Bashdate +%s

The year 2038 problem

Systems that store Unix time as a signed 32-bit number overflow at 03:14:07 UTC on 19 January 2038 (timestamp 2147483647) and wrap around to 1901. Modern systems use 64-bit time, which lasts for billions of years.

Frequently asked questions

Does a Unix timestamp depend on the time zone?

No. A timestamp is the same everywhere. Only the date and time it's displayed as changes with the time zone.

How are daylight saving changes handled?

Conversions use your browser's built-in time zone database. When a local time occurs twice (clocks go back), the earlier one is used. When it doesn't exist (clocks go forward), it's moved forward an hour.

Can I convert dates before 1970?

Yes. Earlier dates have negative timestamps, e.g. -86400 is 31 December 1969.

What about leap seconds?

Unix time ignores leap seconds: every day is exactly 86,400 seconds.

Add this Unix timestamp converter to your website

Free for blogs, schools and businesses. Copy the code below and paste it into your page's HTML. The tool works exactly like this one and runs in your visitors' browsers, so nothing is uploaded. Please keep the credit line so others can find it too.

Preview embed ↗