Unix Timestamp Converter

Turn an epoch timestamp into a date, or a date into a timestamp. Seconds, milliseconds, microseconds and nanoseconds are told apart by length.

Current Unix timestamp

0 seconds

Timestamp to date

Date to timestamp

Your data stays in your browser

This tool runs on JavaScript inside your browser. Nothing you add here is uploaded to our server, so it works for confidential data too. How we handle data

  • No upload
  • Processed on your device
  • No account

Reading a timestamp

  1. Paste the timestamp under Timestamp to date. Commas and spaces are ignored.
  2. Check the line that says how it was read (seconds, milliseconds and so on). Change the unit if it guessed wrong.
  3. Read the date in UTC, your own time zone and Pakistan time, and copy whichever you need.
  4. To go the other way, pick a date, time and time zone under Date to timestamp.

What is a Unix timestamp?

The number of seconds since midnight UTC on 1 January 1970, not counting leap seconds. It's how most databases, APIs and log files store time, because one number means the same moment everywhere. 1700000000 was 22:13:20 UTC on 14 November 2023, which was already 03:13 the next morning in Pakistan. Dates before 1970 are negative: -86400 is 31 December 1969.

Is my timestamp in seconds or milliseconds?

Count the digits. A current timestamp in seconds has 10 digits, milliseconds has 13 (JavaScript and Java use these), microseconds 16 and nanoseconds 19. The converter reads the length and says which it picked; switch the unit yourself if you're working with very old or far-future dates.

How do I get the current timestamp in code?

  • JavaScript: Math.floor(Date.now() / 1000) (Date.now() alone gives milliseconds)
  • PHP: time(), and date('Y-m-d H:i:s', $ts) to format one
  • Python: int(time.time()) after import time
  • MySQL: SELECT UNIX_TIMESTAMP(); and FROM_UNIXTIME(1700000000) to read one
  • Linux or macOS terminal: date +%s
  • Excel or Google Sheets: =(A1-DATE(1970,1,1))*86400 turns a UTC date in A1 into a timestamp, and =A1/86400+DATE(1970,1,1) turns a timestamp back into a date (format the cell as a date)

What happens in 2038?

Old systems that store the timestamp as a signed 32-bit number run out at 2147483647, which is 03:14:07 UTC on 19 January 2038. One second later they wrap around to 1901. Modern systems use 64 bits and are fine for billions of years, but embedded devices and old databases are still worth checking.

Why does my converted time look an hour off?

Usually daylight saving. Pakistan doesn't use it, but London, New York and much of Europe do, so the same UTC moment is a different local hour in summer and winter. When you convert a date to a timestamp, the tool uses the offset in force on that date, and it tells you if the time was skipped when clocks went forward or happens twice when they went back.

Reading the exp or iat claim in a login token? The JWT Decoder converts those for you. Converting a meeting time between cities is easier with the Time Zone Converter, and the gap between two dates is a job for Days Between Dates.

Questions people ask

How do I convert a Unix timestamp to a date?

Paste it under Timestamp to date. You'll see the date in UTC, in your own time zone and in Pakistan time.

How do I convert epoch time to Pakistan time?

Pakistan Standard Time is UTC+5 all year, so add 5 hours to the UTC time. The converter shows the Pakistan time on its own line.

What is the current Unix timestamp?

It's shown live at the top of the page in seconds and milliseconds, and you can copy it in one click.

How do I tell seconds from milliseconds?

A current timestamp in seconds has 10 digits; in milliseconds it has 13. The converter detects this from the length.

Can a Unix timestamp be negative?

Yes. Negative numbers are dates before 1 January 1970. For example, -86400 is 31 December 1969.

How do I convert a date to a timestamp in Excel?

For a UTC date in A1, use =(A1-DATE(1970,1,1))*86400. For a timestamp in A1, use =A1/86400+DATE(1970,1,1) and format the cell as a date.

Does a Unix timestamp include time zones?

No. It always counts from midnight UTC, so the same number is the same moment everywhere. Time zones only matter when you display it.

Related tools