Home / Tools / Unix timestamp converter

Unix timestamp converter

Convert a Unix timestamp to a readable date in UTC and your local time zone, or turn a date into a timestamp.

  • Code tool
  • Runs in your browser
  • Tested 19 November 2026
  • Sources
Seconds or milliseconds. The tool works out which.

What a Unix timestamp is

A Unix timestamp counts the seconds since midnight UTC on 1 January 1970, called the epoch, ignoring leap seconds. It's the same everywhere in the world at the same moment, which makes it ideal for logs, databases and APIs. Converting it to a local time happens only when a person needs to read it.

Many systems count in milliseconds instead. JavaScript's Date.now() does, for example. A timestamp with 13 digits is almost certainly milliseconds, and the tool treats anything above 100 billion that way.

Getting the time in code

# Python
import time, datetime
time.time()                                        # seconds, as a float
datetime.datetime.fromtimestamp(1700000000, datetime.timezone.utc)

// JavaScript
Date.now()                                         // milliseconds
new Date(1700000000 * 1000).toISOString()          // '2023-11-14T22:13:20.000Z'

Some MicroPython ports count from 1 January 2000 instead of 1970. Check with time.gmtime(0) before mixing timestamps from a board with ones from a PC.

The year 2038 problem

Older systems store the timestamp as a signed 32-bit integer, which runs out at 03:14:07 UTC on 19 January 2038 and then wraps round to 1901. Modern operating systems and languages use 64 bits, but old embedded devices and file formats may not. Try 2147483647 and 2147483648 above to see the boundary. Our base converter shows why: 2147483647 is 0x7FFFFFFF, the largest positive 32-bit signed number.

Sources

Where the formulas and figures on this page come from. We test every tool against worked examples from these before publishing.