What Is a Unix Timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, the "Unix epoch", not counting leap seconds. It's the most common way computers store and exchange moments in time: databases, log files, APIs, JSON payloads, JWT tokens, file systems and programming languages all use it because a single number is compact, unambiguous and independent of time zones.
Timestamps aren't human-readable, though. 1700000000 means 14 November 2023 at 22:13:20 UTC. This free Unix timestamp converter translates them both ways, automatically detects whether a value is in seconds, milliseconds (JavaScript, Java), microseconds (Python, PostgreSQL) or nanoseconds (Go, some logs), and shows the result in UTC, your local time or any of 400+ time zones.
How to Convert a Unix Timestamp
- Paste the timestamp into the "Timestamp → date" box. The unit is detected from the number of digits.
- Choose a time zone to see the local date and time there.
- To go the other way, enter a date, time and zone in "Date → timestamp".
- For many values, paste a list into the batch converter.
Timestamp Units
| Unit | Digits (today) | Example | Common in |
|---|---|---|---|
| Seconds | 10 | 1700000000 | Unix, PHP, MySQL, most APIs |
| Milliseconds | 13 | 1700000000000 | JavaScript Date.now(), Java |
| Microseconds | 16 | 1700000000000000 | Python time_ns/1000, PostgreSQL |
| Nanoseconds | 19 | 1700000000000000000 | Go, InfluxDB, some logs |
Get the Current Timestamp in Code
- JavaScript:
Math.floor(Date.now() / 1000) - Python:
import time; int(time.time()) - PHP:
time() - Java:
Instant.now().getEpochSecond() - SQL (MySQL):
UNIX_TIMESTAMP() - Bash:
date +%s
Features
- Auto unit detectionSeconds, ms, µs and ns.
- Any time zoneDST-aware conversion to 400+ zones.
- Two-wayTimestamp to date and date to timestamp.
- Multiple formatsISO 8601, RFC 2822, local and relative time.
- Live epoch clockThe current timestamp, ready to copy.
- Batch modeConvert hundreds of timestamps at once.
The Year 2038 Problem
Systems that store timestamps as signed 32-bit integers can only count up to 2,147,483,647 seconds, which is reached at 03:14:07 UTC on 19 January 2038. After that the value overflows to a negative number, which would be interpreted as December 1901. Modern systems use 64-bit timestamps, which will last for billions of years, but embedded devices and old databases may still be affected.
Working with Timestamps in Practice
When debugging, you'll often find timestamps in log files, database rows, API responses and browser storage. A few quick checks help avoid mistakes. A value around 1.7 billion is a current date in seconds, while around 1.7 trillion is milliseconds. A date in 1970 usually means a zero or missing value, or milliseconds interpreted as seconds. A date tens of thousands of years in the future means seconds interpreted as milliseconds the other way round. Timestamps also never contain a time zone, so apparent "off by a few hours" errors usually come from displaying UTC as local time or vice versa.
ISO 8601 strings such as 2025-03-01T12:00:00Z are the human-readable alternative. The Z means UTC, and offsets like +05:30 indicate a local time. They sort correctly as text and are widely supported by programming languages and databases.
Seconds in Common Periods
- 1 minute = 60 seconds
- 1 hour = 3,600 seconds
- 1 day = 86,400 seconds
- 1 week = 604,800 seconds
- 30 days = 2,592,000 seconds
- 1 year (365 days) = 31,536,000 seconds
Adding these values to a timestamp is a quick way to compute expiry times, cache lifetimes and token validity in code.
Frequently Asked Questions
What is the current Unix timestamp?
It's shown live at the top of the page and updates every second. Click Copy to use it.
How do I convert a date to a timestamp?
Use the "Date → timestamp" section: pick the date, time and time zone to get the value in seconds and milliseconds.
What is epoch time?
The number of seconds since 1 January 1970 00:00:00 UTC. It's the same everywhere in the world at a given moment.
How do I know if my timestamp is in seconds or milliseconds?
Current timestamps in seconds have 10 digits; milliseconds have 13. The converter detects this automatically.
Do Unix timestamps include time zones?
No. A timestamp is always UTC-based; the time zone only matters when displaying it as a local date.
Can timestamps be negative?
Yes. Negative values represent dates before 1970, e.g. -86400 is 31 December 1969.
Are leap seconds counted?
No. Unix time ignores leap seconds, so every day is exactly 86,400 seconds.