Unix timestamp converter
Convert between Unix timestamps and human-readable dates
Current Unix timestamp
—
—
Timestamp → date
Common timestamps
Date → timestamp
—
01
What is a Unix timestamp?
A Unix timestamp counts the seconds since the Unix epoch, 00:00:00 UTC on 1 January 1970. Timestamp 0 is the epoch itself, and negative values are earlier dates. It is a single number with no time zone, which makes it easy to store, sort and compare, so databases, APIs, logs and JWTs use it widely. Many systems, including JavaScript, count milliseconds instead.
This converter shows the current timestamp live and converts a timestamp to a date or a date to a timestamp. It detects seconds or milliseconds from the number of digits and shows local time, UTC, ISO 8601 and a relative time, such as 3 hours ago. You can switch between 12-hour and 24-hour clocks. Conversions run in your browser.
02
How to convert a Unix timestamp
- Paste a timestamp in seconds or milliseconds into Timestamp → date.
- Read the local time, UTC, ISO 8601 and relative time.
- To go the other way, pick a date and time in Date → timestamp, or click Now.
- Copy the result in seconds or milliseconds.
03
Unix timestamp FAQ
- How do I tell seconds from milliseconds?
- Look at the length. A current timestamp in seconds has 10 digits, such as 1700000000, and one in milliseconds has 13, such as 1700000000000. The converter treats 13 digits or more as milliseconds. If a date comes out in 1970 or thousands of years ahead, the unit is probably wrong.
- What is the Year 2038 problem?
- Systems that store Unix time as a signed 32-bit integer can count only up to 2147483647, which is 03:14:07 UTC on 19 January 2038. One second later the value overflows and wraps to a date in 1901. Most modern systems use 64-bit time, but old embedded devices and some file formats may still be affected.
- How do I get the current Unix timestamp in code?
- In JavaScript, use Math.floor(Date.now() / 1000) for seconds, since Date.now() returns milliseconds. In Python, import time and use int(time.time()). In MySQL, use UNIX_TIMESTAMP(), and in PostgreSQL, EXTRACT(EPOCH FROM now()). In a Linux or macOS terminal, date +%s prints it.
- Are the dates I convert sent anywhere?
- No. Timestamps and dates are converted in your browser with its built-in date functions, using your device's time zone for local time. Nothing you enter is sent to a server or stored.
04