go-supertools
Developer & Data Tools

Timestamp Converter

Convert UNIX Timestamps

Runs in your browser Your input never leaves your device.

0 characters | 0 words
—

Report a problem with this tool

About this tool

Convert between Unix timestamps and readable dates. Enter a Unix timestamp and the tool works out the unit from its size: numbers under 100 billion are seconds (10 digits is today's range), up to 100 trillion are milliseconds (13 digits), up to 100 quadrillion are microseconds (16 digits) and anything bigger is nanoseconds (19 digits). A "Read as" line tells you which one it chose. You can also type a date such as 2023-11-14T22:13:20Z. The result shows Unix seconds, Unix milliseconds, ISO 8601, UTC and your local time. Leave the box empty to see the current time. A four-digit number is read as a year, not a timestamp. Conversion happens in your browser using your device's clock and time zone for the local line. Dates in a format your browser does not recognize are rejected.

How to use it

  1. Paste a Unix timestamp or type a date, or leave the box empty for the current time.
  2. Read the results: Unix seconds and milliseconds, ISO 8601, UTC and local time.
  3. Copy the line you need.

Example

The Local line depends on your device settings.

Input
1700000000
Result
Unix (s):   1700000000
Unix (ms):  1700000000000
ISO 8601:   2023-11-14T22:13:20.000Z
UTC:        Tue, 14 Nov 2023 22:13:20 GMT
Local:      (your local time zone)

What a Unix timestamp is

A Unix timestamp counts the seconds since 1970-01-01 00:00:00 UTC, called the Unix epoch. It has no time zone: the same moment has the same timestamp everywhere, and only the local display changes. Leap seconds are not counted.

Today's timestamps are 10 digits in seconds. Many systems use milliseconds instead, which gives 13 digits, for example JavaScript's Date.now() and Java's System.currentTimeMillis(). Negative timestamps are dates before 1970, and this tool accepts them.

Get or convert a timestamp in code

JavaScript  Math.floor(Date.now() / 1000)
            new Date(1700000000 * 1000).toISOString()
Python      import time; int(time.time())
            datetime.fromtimestamp(1700000000, tz=timezone.utc)
PHP         time()
            date('c', 1700000000)
Bash (GNU)  date +%s
            date -u -d @1700000000
MySQL       SELECT UNIX_TIMESTAMP();
            SELECT FROM_UNIXTIME(1700000000);
PostgreSQL  SELECT extract(epoch FROM now());
            SELECT to_timestamp(1700000000);

The year 2038 problem

Systems that store seconds in a signed 32-bit integer can only count to 2147483647, which is 2038-01-19 03:14:07 UTC. One second later the value wraps to a negative number and reads as December 1901. Paste 2147483647 here to see the limit. Software that stores time as 64-bit values does not have this problem.

Common problems

"Unrecognized date or timestamp"
Numbers are read by size (seconds, milliseconds, microseconds or nanoseconds) and four digits are read as a year. Anything else is passed to the browser as a date string, which fails for unusual formats such as 14/11/2023. Use 2023-11-14 or 2023-11-14T22:13:20Z.
Wrong date by a factor of 1000
Check the "Read as" line. An 11 or 12-digit number is ambiguous, because it could be seconds in the far future or milliseconds from the 1970s; the tool picks seconds below 100 billion and milliseconds above. Add or remove three zeros if you meant the other unit.
Date without a time zone shifts
A string like 2023-11-14 is read as UTC but 2023-11-14 10:00 is read as local time. Add Z or an offset to be explicit.

Frequently asked questions

Is a Unix timestamp in UTC or local time?

Neither, strictly: it is a count of seconds from a fixed UTC moment, so it does not carry a time zone. The UTC and Local lines show the same instant in two time zones.

Can I enter a timestamp with decimals?

Yes, for seconds with up to 11 digits before the point, such as 1700000000.5. The fraction is kept to the millisecond. Larger decimal values are rejected; enter them as whole milliseconds instead.

How do I convert a date to a Unix timestamp?

Type the date in a standard format such as 2023-11-14T22:13:20Z and read the Unix (s) or Unix (ms) line. Leave out the Z or offset only if you mean your local time.