Epoch Converter: Unix Timestamp to Date and Back
Turn a Unix timestamp into a readable date, or a date into epoch time, in any time zone. The unit (seconds, milliseconds, microseconds or nanoseconds) is detected for you, and you can also type plain English such as “next Friday at 3pm” or convert a whole list at once.
- Live epoch clock
- Any time zone
- Batch convert and CSV
- Runs in your browser
Current Unix time
seconds since 1 January 1970 (UTC)
Epoch to date
Date to epoch
Uses the time zone selected at the top. 24-hour clock.
Describe a time in plain English
Batch converter
Paste one timestamp or date per line (up to 2,000). Numbers become dates, dates and words become timestamps.
| Input | Detected | Unix seconds | ISO 8601 (UTC) | ISO 8601 (UTC) |
|---|
How to use
- Epoch to date: paste a Unix timestamp. The unit is detected from the digit count (10 = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds), or choose it yourself.
- Date to epoch: fill in the year, month, day and time. You get seconds, milliseconds, microseconds and nanoseconds.
- Pick the time zone at the top. It is used for every converter on the page, and it is remembered next time.
- Use Describe a time for phrases like “tomorrow at 9am”, or the Batch converter for a list. Press the copy icon next to any result.
- Copy link makes a link that opens this page with your timestamp already filled in.
What is epoch time?
Epoch time, also called Unix time or POSIX time, counts the seconds since 00:00:00 UTC on 1 January 1970, the Unix epoch. Because it is one number with no time zone, it is the easiest way for programs, databases, logs and APIs to agree on an exact moment. A timestamp such as 1700000000 means 14 November 2023 22:13:20 UTC wherever you are; only the clock time you read changes with the time zone.
Many systems store milliseconds instead of seconds: JavaScript’s Date.now(), Java and most JSON APIs do. Databases and high-resolution timers may use microseconds or nanoseconds. If a converted date lands in 1970 or in the far future, the unit is probably wrong: the number is 1,000 times too big or too small.
Seconds in common time units
| Unit | Seconds |
|---|---|
| 1 second | 1 |
| 1 minute | 60 |
| 1 hour | 3,600 |
| 1 day | 86,400 |
| 1 week | 604,800 |
| 1 month (30.44 days) | 2,629,743 |
| 1 year (365.24 days) | 31,556,926 |
Get the current epoch time in code
| Language | Current Unix time in seconds |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | import time; int(time.time()) |
| PHP | time() |
| Java | System.currentTimeMillis() / 1000L |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| Go | time.Now().Unix() |
| Ruby | Time.now.to_i |
| Rust | SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() |
| Swift | Int(Date().timeIntervalSince1970) |
| Kotlin | System.currentTimeMillis() / 1000 |
| C / C++ | time(NULL) // std::time(nullptr) |
| MySQL | SELECT UNIX_TIMESTAMP(); |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM now())::bigint; |
| SQL Server | SELECT DATEDIFF(SECOND, '1970-01-01', GETUTCDATE()); |
| Bash | date +%s |
| PowerShell | [DateTimeOffset]::UtcNow.ToUnixTimeSeconds() |
| Excel | =(NOW()-DATE(1970,1,1))*86400 (for UTC use a UTC time) |
Frequently asked questions
What is epoch time (Unix time)?
Epoch time is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC, not counting leap seconds. It is a single number that means the same instant in every time zone, which is why computers, databases and APIs use it.
How do I know if a timestamp is in seconds or milliseconds?
Count the digits. Today a timestamp in seconds has 10 digits (like 1700000000), milliseconds have 13, microseconds 16 and nanoseconds 19. This converter detects the unit from the number of digits, and you can also pick the unit yourself.
Is a Unix timestamp in UTC or local time?
A Unix timestamp has no time zone: it counts from the epoch in UTC. The time zone only matters when you turn it into a readable date, so this tool shows the same instant in UTC and in your own or any other zone you choose.
What happens in the year 2038?
Systems that store the timestamp in a signed 32-bit integer overflow on 19 January 2038 at 03:14:07 UTC (timestamp 2147483647). Modern systems use 64-bit values, which last for billions of years.
Can a timestamp be negative?
Yes. Negative values are moments before 1 January 1970. For example, -86400 is 31 December 1969 00:00:00 UTC.
Are my timestamps sent to a server?
No. All conversions run in your browser with JavaScript. Nothing you type is uploaded or stored on our servers.