Unix timestamp to date
Seconds, ms, microseconds or nanoseconds.
Date to Unix timestamp
ISO 8601 such as 2026-05-26T12:00:00Z or +05:30, or RFC 2822. Without Z or an offset it is read in your browser's time zone.
Batch convert
One value per line. Timestamps become dates in the time zone chosen above; dates become Unix seconds. Up to 5,000 lines.
Seconds to days, hours and minutes
1 day, 1 hour, 1 minute, 1 second (1.04 days)
Math.floor(Date.now() / 1000) // seconds Date.now() // milliseconds new Date(1767225600 * 1000) // to a Date
import time, datetime int(time.time()) datetime.datetime.fromtimestamp(1767225600, datetime.timezone.utc)
time();
date('Y-m-d H:i:s', 1767225600);Instant.now().getEpochSecond(); Instant.ofEpochSecond(1767225600);
DateTimeOffset.UtcNow.ToUnixTimeSeconds(); DateTimeOffset.FromUnixTimeSeconds(1767225600);
time.Now().Unix() time.Unix(1767225600, 0).UTC()
Time.now.to_i Time.at(1767225600).utc
SELECT UNIX_TIMESTAMP(); SELECT FROM_UNIXTIME(1767225600);
SELECT EXTRACT(EPOCH FROM now())::bigint; SELECT to_timestamp(1767225600);
date +%s date -u -d @1767225600 # GNU date -u -r 1767225600 # macOS
[DateTimeOffset]::UtcNow.ToUnixTimeSeconds()
How to use
Enter a timestamp
Type or paste a value into Unix timestamp. Today's dates are 10 digits in seconds and 13 in milliseconds, and Detect from length works out the unit. Choose a zone under Show in time zone.
Read the date or convert back
The results show the unit, the date in your zone, ISO 8601, RFC 2822, the offset and relative time, each with Copy. Under Date to Unix timestamp, pick a date, time and zone to get seconds and milliseconds.
Use the extra tools
Copy start and end timestamps for a day, week, month or year, paste a list into Batch convert and download a CSV, or turn a number of seconds into days, hours and minutes.
Why Unix Timestamp Converter
- Detects or sets seconds, milliseconds, microseconds and nanoseconds.
- Any IANA time zone, with the same moment shown in 17 common zones.
- Date picker with zone, start and end of periods, and batch conversion.
- Live current Unix time you can pause, plus code for 11 languages.
Seconds, milliseconds, microseconds and nanoseconds
Different systems count Unix time in different units, and mixing them up is a classic bug. If a 13-digit millisecond value is read as seconds, you get a date tens of thousands of years in the future. If a 10-digit seconds value is read as milliseconds, you get a date in January 1970.
The table shows the same moment, 1 January 2026 at 00:00 UTC, in each unit. This converter tells them apart by size, so paste any of these and you get the same date back.
| Unit | Digits today | Example | Where you see it |
|---|---|---|---|
| Seconds | 10 | 1767225600 | Unix tools, PHP time(), JWT exp and iat claims |
| Milliseconds | 13 | 1767225600000 | JavaScript Date.now(), Java, many JSON APIs |
| Microseconds | 16 | 1767225600000000 | Some databases and tracing tools |
| Nanoseconds | 19 | 1767225600000000000 | Go's UnixNano(), InfluxDB, OpenTelemetry |
Get the current Unix timestamp in code
Most languages have a one-line way to read the current time as a Unix timestamp. Seconds are the traditional unit; milliseconds are the default in JavaScript and Java. Compare the value your code prints with the live clock at the top of this page to confirm you are using the unit you expect. When you store timestamps, pick one unit for the whole system and name the column or field after it, such as created_at_ms.
| Language | Seconds | Milliseconds |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | Date.now() |
| Python | int(time.time()) | int(time.time() * 1000) |
| PHP | time() | (int) (microtime(true) * 1000) |
| Java | Instant.now().getEpochSecond() | System.currentTimeMillis() |
| Go | time.Now().Unix() | time.Now().UnixMilli() |
| PostgreSQL | EXTRACT(EPOCH FROM now())::bigint | (EXTRACT(EPOCH FROM now()) * 1000)::bigint |
| MySQL | UNIX_TIMESTAMP() | Not built in as one call |
| Bash (GNU date) | date +%s | date +%s%3N |