Unix timestamp converter

A Unix timestamp counts the seconds since January 1, 1970, 00:00:00 UTC. This page turns any Unix timestamp into a readable date, and any date back into a timestamp, in seconds, milliseconds, microseconds or nanoseconds. It is free, there is no signup, and everything runs in your browser.

Last verified: November 6, 2026 · Primary sources: MDN Web Docs and Wikipedia Unix time · Independent tool, not affiliated with any vendor

Current Unix time

Seconds––
Milliseconds–JavaScript Date.now()

The clock reads your device clock once a second. Seconds are what most APIs and databases store; milliseconds are what JavaScript, Java and many web APIs return. Both numbers above name the same moment.

Timestamp to date

Auto-detect reads the size of the number: under 100 billion is seconds, under 100 trillion is milliseconds, under 100 quadrillion is microseconds, and anything larger is nanoseconds. A 10-digit timestamp from today is seconds; a 13-digit one is milliseconds. If the number could be either, pick the unit by hand.

Date to timestamp

The date you pick is read as a wall-clock time in the timezone you choose. Daylight saving time comes from that zone's own rules, so noon in New York converts to 16:00 UTC in June and 17:00 UTC in January.

Convert a batch

Each line is read on its own: the first number of 8 to 19 digits is treated as the timestamp, and the rest of the line is ignored. That is the shape of a log line, a database dump, or a column copied out of a spreadsheet. Lines with no such number are reported, not silently dropped.

What is a Unix timestamp?

A Unix timestamp, also called Unix time, POSIX time, or epoch time, is the number of seconds that have passed since January 1, 1970, at 00:00:00 UTC. That fixed starting point is the Unix epoch. The timestamp 1716192000 names May 20, 2024, at 08:00:00 UTC, and the same number names the same moment in every timezone, because the number itself carries no timezone at all.

Systems store time this way because one integer is easy to compare, sort, and subtract. The difference between two timestamps is the number of seconds between the two moments, with no calendar math in between. Dates, timezones, and daylight saving time only appear when the number is shown to a person, which is what this page does.

Unix time ignores leap seconds: every day is treated as exactly 86,400 seconds. That keeps the arithmetic clean, and it means Unix time now sits 27 seconds behind the astronomical time kept by leap seconds. A timestamp is also not a date format for humans. It needs a converter, a library, or a line of code before anyone can read it, and the code section below shows the usual forms.

Seconds, milliseconds, microseconds, nanoseconds

Four units are in common use, and mixing them up is the most common timestamp bug: a 10-digit timestamp read as milliseconds lands in 1970, and a 13-digit one read as seconds lands in the year 50000. The digit count gives the unit away.

UnitDigits todayExampleUsed by
Seconds101716192000Unix and Linux system calls, Python time.time(), PHP time(), Go time.Now().Unix(), PostgreSQL EXTRACT(EPOCH)
Milliseconds131716192000000JavaScript Date.now(), Java System.currentTimeMillis(), most web APIs
Microseconds161716192000000000Python time.time_ns(), high precision logging, database internals
Nanoseconds191716192000000000000Go time.Now().UnixNano(), system clocks, tracing spans

When a value arrives without a unit, check the digits first, then check the source. JavaScript returns milliseconds, Python returns seconds as a float, and Go has a function for each. If the number is 10 digits, it is seconds; if it is 13, it is milliseconds. This page detects the unit from the size of the number and labels which one it used, so a wrong guess is visible at once.

Convert a timestamp in code

Use the standard library in production. The snippets below show the shape of the work in each language, so a conversion can be checked by hand. The JavaScript and Python versions were run while this page was written.

JavaScript

// Unix seconds to a Date object
const seconds = 1716192000;
const date = new Date(seconds * 1000);
date.toISOString(); // "2024-05-20T08:00:00.000Z"

// Current Unix timestamp in seconds
const nowSeconds = Math.floor(Date.now() / 1000);
// Date object back to Unix seconds
const backToSeconds = Math.floor(date.getTime() / 1000);

Python

from datetime import datetime, timezone
timestamp = 1716192000
dt = datetime.fromtimestamp(timestamp, tz=timezone.utc)
dt.isoformat()  # "2024-05-20T08:00:00+00:00"
# Current Unix timestamp in seconds
import time
now_seconds = int(time.time())

Go

import "time"
// Unix seconds to a time value, in UTC
t := time.Unix(1716192000, 0).UTC()
// Current Unix timestamp in seconds
now := time.Now().Unix()
// Current Unix timestamp in nanoseconds
nowNano := time.Now().UnixNano()

SQL and shell

-- PostgreSQL
SELECT to_timestamp(1716192000); -- 2024-05-20 08:00:00+00
-- MySQL
SELECT FROM_UNIXTIME(1716192000); -- 2024-05-20 08:00:00
# Shell, GNU date
date -u -d @1716192000 # Mon May 20 08:00:00 UTC 2024

The Go functions are the ones listed in the Go time package documentation, and the Python call is the documented datetime.fromtimestamp form with an explicit UTC timezone. The SQL forms are the documented PostgreSQL to_timestamp and MySQL FROM_UNIXTIME functions.

Notable timestamps

A few numbers are worth recognising on sight, because they turn up in tests, in documentation, and in old data.

TimestampDate (UTC)Why it matters
01970-01-01 00:00:00The Unix epoch, the starting point of Unix time
10000000002001-09-09 01:46:40The first 10-digit timestamp, celebrated as the billion-second party
12345678902009-02-13 23:31:30The sequential digits 1234567890, a common test value
17000000002023-11-14 22:13:20A round 1.7 billion, often used in examples and fixtures
21474836472038-01-19 03:14:07The largest signed 32-bit integer, the end of the line for 32-bit Unix time

The year 2038 problem

Old systems that store Unix timestamps as signed 32-bit integers hold at most 2,147,483,647. That number is reached on January 19, 2038, at 03:14:07 UTC. One second later the counter wraps to a negative number, which the system reads as December 13, 1901. 64-bit systems are not affected: Linux moved to a 64-bit time type in 2020 for 32-bit architectures, and PostgreSQL, MySQL 8, Python 3, Node.js, Go, and Java 8 and later all use 64-bit integers internally. The risk that remains sits in old embedded systems and file formats that still store 32-bit times.

Frequently asked questions

How do I tell seconds from milliseconds in a Unix timestamp?

Count the digits. A timestamp in seconds is 10 digits for dates between 2001 and 2286, for example 1716192000. A timestamp in milliseconds is 13 digits, for example 1716192000000. This page detects the unit from the size of the number, so you can paste either one.

Is a Unix timestamp in a timezone?

No. A Unix timestamp is a count of seconds since January 1, 1970, 00:00:00 UTC, and it names the same moment everywhere on Earth. Timezones only enter the picture when the number is turned into a readable date, which is why the converter shows the same timestamp in UTC, in your local time, and in any timezone you pick.

Can a Unix timestamp be negative?

Yes. Negative timestamps name moments before the epoch: -1 is December 31, 1969, 23:59:59 UTC, and -315619200 is January 1, 1960. Negative timestamps convert the same way positive ones do.

Do Unix timestamps count leap seconds?

No. Unix time treats every day as exactly 86,400 seconds, so leap seconds are ignored. That makes date math simple, but it also means Unix time drifts from astronomical time by the number of leap seconds inserted since 1972, which is 27.

What is the year 2038 problem?

Systems that store Unix timestamps as signed 32-bit integers run out of room on January 19, 2038 at 03:14:07 UTC, when the largest 32-bit value 2147483647 is reached. After that the counter wraps to a negative number, which the system reads as a date in December 1901. 64-bit systems are not affected.

Can I convert a date in a timezone other than my own?

Yes. The date to timestamp tool takes a timezone, so you can enter a wall-clock time in New York, Singapore, or any other zone and get the matching Unix timestamp. Daylight saving time is handled from the zone's own rules, so a summer date and a winter date in the same zone get different offsets.

Sources

Mozilla Developer Network, Date: JavaScript Date stores milliseconds since the epoch, and Date.now() returns the current time in milliseconds.

Wikipedia, Unix time: the epoch definition, the leap second count of 27, and the year 2038 problem.

Internet Engineering Task Force, RFC 3339: Date and Time on the Internet: the ISO 8601 profile used for the timestamp format shown on this page.

Go project, time package: time.Unix, UnixNano, and the nanosecond precision of Go time values.

Python Software Foundation, datetime: datetime.fromtimestamp with an explicit UTC timezone, and time.time() returning seconds as a float.

Agents

Machine readable summary for AI assistants: