Tabwrench tools Small tools that run in your browser. No sign-up, no upload.
Tools / Generate / convert / Unix time converter

Unix time converter

Paste a timestamp to see the date in UTC, your own time zone and one more of your choice. Seconds, milliseconds, microseconds and nanoseconds are told apart automatically.

Runs in your browser. Nothing you paste leaves this page.

Current Unix time (seconds)

Timestamp to date

Date to timestamp

What Unix time counts

Unix time is the number of seconds since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It has no time zone. The same number means the same instant everywhere, and a time zone is only applied when the number is shown as a date.

Seconds or milliseconds?

Different systems store different precision. The page decides by the size of the number.

Digits (for current dates)UnitWhere you see it
10SecondsUnix tools, JWT exp and iat, PHP, Python time.time() (as a float)
13MillisecondsJavaScript Date.now(), Java System.currentTimeMillis()
16MicrosecondsPostgreSQL internals, some logging systems
19NanosecondsGo UnixNano(), some tracing formats

A date in 1970 that should be recent means a seconds value was read as milliseconds. A date tens of thousands of years ahead means the opposite.

Getting the current timestamp in code

JavaScript   Math.floor(Date.now() / 1000)
Python       int(time.time())
Go           time.Now().Unix()
Java         Instant.now().getEpochSecond()
PHP          time()
Bash         date +%s
SQL          SELECT EXTRACT(EPOCH FROM now());   -- PostgreSQL
             SELECT UNIX_TIMESTAMP();            -- MySQL

Questions

What is the year 2038 problem?

A signed 32-bit integer can count seconds only up to 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. Systems that still store time in 32 bits will overflow at that moment. 64-bit timestamps do not have the problem.

Why is my converted time off by some hours?

The timestamp is fine and the time zone is not what you expected. Compare the UTC row with the local row.

Can a timestamp be negative?

Yes. Negative values are dates before 1970.

Related tools