Search tools

Unix Timestamp Converter

Turn Unix timestamps into readable dates and back, in seconds or milliseconds.

Runs entirely in your browser. Nothing you paste is sent to our server, stored or logged.

Current Unix time

Timestamp to date

Date to timestamp

The same moment, every way

Click a value to copy it

Paste a Unix timestamp to see the moment it stands for, in UTC and in your own time zone, or pick a date to get its timestamp. The converter tells seconds, milliseconds, microseconds and nanoseconds apart by their length, so a 13 digit value from JavaScript and a 10 digit one from Python both come out right.

What is a Unix timestamp?

Unix time counts the seconds since midnight UTC on 1 January 1970, a moment known as the Unix epoch. It has no time zone at all, which is why it is the favorite way to store and compare times in databases, APIs and log files. A timestamp only turns into a local date and time when you display it.

Seconds or milliseconds?

Most Unix tools and languages such as Python, PHP and Go work in seconds, which today is a 10 digit number. JavaScript, Java and many web APIs use milliseconds, which adds three more digits. If a converted date lands in January 1970 or thousands of years in the future, a mix up between the two is almost always the reason.

The year 2038 problem

Systems that keep Unix time in a signed 32 bit integer run out of room at 03:14:07 UTC on 19 January 2038, when the number wraps around to 1901. Modern systems use 64 bit time and are safe for billions of years, but old databases, embedded devices and file formats can still carry the limit, so it is worth checking anything that stores dates far into the future.

How to use the timestamp converter

  1. Paste a timestampEnter any Unix timestamp. The unit is worked out from the number of digits.
  2. Read the dateSee the moment in UTC, in your time zone, as ISO 8601 and as a relative time.
  3. Go the other wayPick a date and time to get its timestamp in seconds and in milliseconds.

Get the current Unix timestamp in code

The same number, in seconds unless the comment says otherwise.

JavaScript

Math.floor(Date.now() / 1000)   // Date.now() alone is milliseconds

Python

import time
int(time.time())

PHP

time();

Go

time.Now().Unix()

Java

Instant.now().getEpochSecond();

Bash

date +%s

PostgreSQL

SELECT EXTRACT(EPOCH FROM now())::bigint;

MySQL

SELECT UNIX_TIMESTAMP();

Common questions

What is the current Unix timestamp?

The live counter at the top of the converter shows it, ticking every second. It is the same number everywhere in the world at the same moment, because Unix time has no time zone.

How do I convert a Unix timestamp to a date in code?

In JavaScript, multiply seconds by 1000 and pass the result to new Date(). In Python, use datetime.fromtimestamp with a time zone, and in PHP pass the timestamp to date(). The examples further down this page show each one.

Why does my timestamp show a date in 1970?

You most likely passed seconds to something that expects milliseconds, such as JavaScript's Date. A 10 digit number is in seconds, so multiply it by 1000 first.

Can a Unix timestamp be negative?

Yes. Negative values count backwards from the epoch, so −86400 is 31 December 1969. The converter handles them, and so do most modern languages.

Does Unix time count leap seconds?

No. Unix time treats every day as exactly 86,400 seconds and quietly absorbs leap seconds. That keeps date arithmetic simple, at the cost of drifting a few seconds from atomic time.

Is anything I enter sent to a server?

No. The conversion runs in your browser using its own date functions, and nothing you type leaves your computer.

Guides