Skip to main content

Unix Timestamp Converter

Current Timestamp

Unix Timestamp (seconds)
—
Unix Timestamp (milliseconds)
—
Local time
—
UTC
—

Timestamp Converter

Timestamp to date

​

Date to timestamp

Time zone: UTC

The top of the page shows the current Unix timestamp in seconds and milliseconds. Below, you can turn a timestamp into a date or a date into a timestamp. Seconds, milliseconds and microseconds are detected from the number of digits, you can pick a time zone, and results show the selected zone, UTC, ISO 8601 and relative time (“2 years ago”) – handy for reading logs, database fields or API parameters.


How to use the timestamp converter​

  1. Current timestamp: updates every 0.1 seconds at the top; turn off “current time” to freeze it for copying.
  2. Timestamp to date: paste a number into “Timestamp”, e.g. 1700000000, and the date appears instantly. The field shows whether it was read as seconds, milliseconds or microseconds; if that’s wrong, choose it under “Unit”.
  3. Date to timestamp: pick a date and time (down to the second) in “Date and time” to get the timestamp in seconds and milliseconds.
  4. Time zone: defaults to your device’s time zone; switch to UTC or another city and both conversions follow it. “Now” resets both inputs to the current time.
  5. Every result has a copy icon.

What is a Unix timestamp?​

A Unix timestamp (epoch time, POSIX time) is the number of seconds since 1 January 1970, 00:00:00 UTC. It doesn’t depend on time zones, which is why programs, databases and APIs use it to store time.

Timestamp 0 is 1970-01-01 00:00:00 UTC; in New York (UTC−5) that was still 31 December 1969, 19:00. The same timestamp shows different local times in different zones, but always means the same instant. Dates before 1970 are negative – -86400 is 1969-12-31 00:00:00 UTC.

Seconds, milliseconds or microseconds?​

UnitDigits todayExampleTypical source
Seconds101700000000Unix, PHP, MySQL, Python int(time.time())
Milliseconds131700000000000JavaScript, Java
Microseconds161700000000000000PostgreSQL, Python time.time_ns() // 1000

If you read milliseconds as seconds, the date jumps more than 50,000 years ahead; read seconds as milliseconds and you land in January 1970. A strange date usually means the wrong unit.

How to get the current timestamp in each language​

Language / toolSecondsMilliseconds
JavaScriptMath.floor(Date.now() / 1000)Date.now()
Pythonint(time.time())time.time_ns() // 1_000_000
JavaInstant.now().getEpochSecond()System.currentTimeMillis()
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
Gotime.Now().Unix()time.Now().UnixMilli()
PHPtime()floor(microtime(true) * 1000)
MySQLUNIX_TIMESTAMP()ROUND(UNIX_TIMESTAMP(NOW(3)) * 1000)
Linux / macOSdate +%sdate +%s%3N (GNU date)

Common timestamps​

Timestamp (seconds)UTC
01970-01-01 00:00:00
10000000002001-09-09 01:46:40
17000000002023-11-14 22:13:20
20000000002033-05-18 03:33:20
21474836472038-01-19 03:14:07

The year 2038 problem​

Many older systems store timestamps as a signed 32-bit integer, whose maximum is 2147483647 – 19 January 2038, 03:14:07 UTC. One second later it overflows to a negative number and the date jumps back to 1901. Modern operating systems and languages mostly use 64-bit values, but old embedded devices and database columns (such as MySQL’s TIMESTAMP type) can still be affected.

Frequently asked questions​

What date is timestamp 0?​

Unix timestamp 0 is 1 January 1970, 00:00:00 UTC, the start of the Unix epoch. In time zones west of UTC, such as New York, it was still 31 December 1969 locally.

How can I tell if a timestamp is in seconds or milliseconds?​

Count the digits: a current time in seconds has 10 digits, in milliseconds 13 and in microseconds 16. This tool detects the unit automatically, and you can also set it yourself.

Why is the converted time off by a few hours?​

A timestamp has no time zone; a zone only matters when you display it as a date. If one system shows UTC and another shows local time, they differ by your UTC offset. Switch the time zone in this tool to compare.

What is the year 2038 problem?​

Systems that store seconds in a signed 32-bit integer can only count up to 19 January 2038, 03:14:07 UTC; after that the value overflows to a negative number. Using 64-bit integers avoids it, and most systems have already switched.

Do leap seconds or daylight saving time affect timestamps?​

Unix time ignores leap seconds – every day has exactly 86,400 seconds – and it is based on UTC, so daylight saving time does not change it. DST only affects how the timestamp is shown in local time, which this tool handles automatically.

Other useful tools