Convert Unix timestamps (seconds or milliseconds) to dates and dates to timestamps, in your time zone and UTC. Shows the current epoch time live.
—Current Unix time (seconds)
—Milliseconds
Timestamp → date
Date → timestamp
💡 Would you like a new tool or feature, or did something not work? Tell us at [email protected]
How to convert a timestamp
Paste a Unix timestamp into the first box. Seconds, milliseconds, microseconds and nanoseconds are detected automatically.
See the date in your time zone, in UTC, in ISO 8601 format, and how long ago (or from now) it is.
To go the other way, pick a date and time and copy the timestamp in seconds or milliseconds.
Getting the current timestamp in code
JavaScript
Math.floor(Date.now() / 1000)
Python
int(time.time())
PHP
time()
Java
Instant.now().getEpochSecond()
C#
DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Bash
date +%s
SQL (PostgreSQL)
extract(epoch from now())
Frequently asked questions
What is a Unix timestamp?
A Unix timestamp (epoch time) is the number of seconds since January 1, 1970 at 00:00:00 UTC. It's how most computers and databases store points in time, because it's a single number that's the same in every time zone.
Seconds or milliseconds?
Unix tools, PHP, Python and most databases use seconds (10 digits today). JavaScript, Java and many APIs use milliseconds (13 digits). This converter detects which one you pasted from the number of digits, and you can also pick it yourself.
What is the year 2038 problem?
Older systems store the timestamp as a signed 32-bit number, which runs out at 2147483647: January 19, 2038 at 03:14:07 UTC. After that it wraps around to 1901. Modern 64-bit systems aren't affected.
Does the timestamp depend on my time zone?
No. The timestamp is always counted in UTC. Only the way it's displayed as a date changes with your time zone, which is why the converter shows both your local time and UTC.