Scrawlspace › Developer Utilities

Unix Timestamp Converter

Convert a Unix epoch timestamp to a readable date, or a date to a timestamp, and see the same moment in ISO 8601, your local time, relative time and a world clock. Seconds, milliseconds, microseconds and nanoseconds are detected from the number of digits.

How to use Timestamp Converter

  1. Paste a timestamp or date into Timestamp or date. The current time is shown under Now with buttons to copy it in seconds or milliseconds.
  2. Read it under Formats: Unix seconds and milliseconds, ISO 8601 (UTC), local time, RFC 2822, relative time, and the day of the year and ISO week.
  3. Or pick a local date and time to get its timestamp.
  4. Add time zones to the World clock, for example UTC and IST (Asia/Kolkata), and copy any value.

Frequently asked questions

What is a Unix timestamp?

The number of seconds since 1 January 1970 00:00:00 UTC, known as the Unix epoch, not counting leap seconds. Many systems and APIs store dates this way, including the exp and iat claims of a JWT.

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

Count the digits. Current timestamps have 10 digits in seconds, 13 in milliseconds, 16 in microseconds and 19 in nanoseconds. The converter reads the unit from the length and shows what it assumed under the input.

How do I convert epoch time to a human-readable date?

Paste the number in. It's shown as a local time, in UTC as ISO 8601, as a relative time such as 3 hours ago, and in any time zones you add. For example, 1700000000 is 14 November 2023 22:13:20 UTC, which is 15 November 2023 03:43:20 in India (IST).

What is the Year 2038 problem?

Systems that store Unix time as a signed 32-bit integer can count only up to 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later the value wraps to a negative number, a date in 1901. 64-bit timestamps don't have this limit.

Can a Unix timestamp be negative?

Yes. Negative values are dates before 1970; -86400 is 31 December 1969. Paste one in with the minus sign.

Does it handle time zones?

Yes. A Unix timestamp is the same everywhere; only its display changes. Results are shown in your local time and UTC, and the world clock shows the same moment in other zones.

Get or convert Unix time in code

JavaScript's Date.now() returns milliseconds, which is why 13-digit timestamps are so common in web APIs.

LanguageCurrent Unix time (seconds)Timestamp to date
JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000).toISOString()
Pythonint(time.time())datetime.fromtimestamp(ts, tz=timezone.utc)
Shell (Linux)date +%sdate -u -d @1700000000
Shell (macOS)date +%sdate -u -r 1700000000
PostgreSQLextract(epoch from now())to_timestamp(1700000000)
MySQLUNIX_TIMESTAMP()FROM_UNIXTIME(1700000000)

Things to know about Unix time