How it works
Unix time counts the seconds since 1 January 1970 at 00:00:00 UTC, the Unix epoch, ignoring leap seconds. It is the same number everywhere on Earth at the same moment, which is why servers, databases and logs store time this way and leave time zones to the display.
Many systems count in smaller units: JavaScript and Java in milliseconds, some databases and tracing tools in microseconds, Go and Linux kernel interfaces often in nanoseconds. The converter tells them apart by length: a timestamp in seconds has 10 digits for any date between 2001 and 2286, in milliseconds 13, in microseconds 16 and in nanoseconds 19. Pick the unit yourself for dates far from today.
The date is shown in UTC, in your browser's time zone and in a zone you choose, using your browser's time zone database, so summer time is applied as it was on that date. ISO 8601 is the form for data and APIs; RFC 2822 is the one in e-mail headers.
Example
1700000000 is 14 November 2023 at 22:13:20 UTC: 2023-11-14T22:13:20Z in ISO 8601 and Tue, 14 Nov 2023 22:13:20 +0000 in RFC 2822. In New York it was 17:13:20 the same day, in India 03:43:20 the next. The same moment in milliseconds is 1700000000000.
Unix time in code
The current epoch time, and an epoch back to a date, in the languages a server runs most:
# Bash (GNU date; macOS: date -r 1700000000)
date +%s
date +%s%3N # milliseconds
date -d @1700000000
# Python
import time; int(time.time())
from datetime import datetime, timezone; datetime.fromtimestamp(1700000000, timezone.utc)
// JavaScript
Math.floor(Date.now() / 1000)
new Date(1700000000 * 1000).toISOString()
<?php
time();
date('c', 1700000000);
-- SQL
SELECT UNIX_TIMESTAMP(); -- MySQL, MariaDB
SELECT EXTRACT(EPOCH FROM now())::bigint; -- PostgreSQL
SELECT unixepoch(); -- SQLite 3.38+
SELECT to_timestamp(1700000000); -- PostgreSQL: epoch to dateQuestions
What is epoch time?
Epoch time, also called Unix time, is the number of seconds since the Unix epoch: 1 January 1970, 00:00:00 UTC. Earlier dates are negative. Nearly every operating system and programming language counts time from it, and an epoch converter like this one turns that number into a readable date and back.
What is the year 2038 problem?
Programs that keep Unix time in a signed 32-bit integer can count only up to 2,147,483,647, which is 19 January 2038 at 03:14:07 UTC. One second later the number wraps to a negative value and reads as December 1901. Current 64-bit systems use a 64-bit time_t and are not affected, but old embedded devices, file formats and database columns that store 32-bit seconds can be.
Is my timestamp in seconds or milliseconds?
Count the digits. A current date in seconds has 10 digits (1700000000), in milliseconds 13 (1700000000000). JavaScript's Date.now() and Java's System.currentTimeMillis() give milliseconds; date +%s, PHP's time() and Python's int(time.time()) give seconds. If a date comes out in 1970 or thousands of years ahead, the unit is wrong.
Do Unix timestamps have a time zone?
No. A timestamp is the same number all over the world at the same instant; it always counts from midnight UTC on 1 January 1970. A time zone only matters when you turn it into a calendar date and clock time, which is why the converter shows the same timestamp in several zones.
Does Unix time count leap seconds?
No. Unix time treats every day as exactly 86,400 seconds, so the 27 leap seconds added to UTC since 1972 (the last at the end of 2016) are not counted. For logs and everyday use this does not matter.