Unix timestamp converter – epoch to date and back
Convert a Unix timestamp (seconds or milliseconds) to a readable date in UTC and your local time zone, or turn any date into a timestamp. With a live epoch clock and code snippets.
0
Timestamp → date
Date → timestamp
What is a Unix timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds since 1 January 1970 at 00:00:00 UTC, not counting leap seconds. It is the same everywhere in the world, which makes it ideal for storing dates in databases, APIs and log files. JavaScript, Java and Kotlin usually work in milliseconds – the same value multiplied by 1,000.
Seconds or milliseconds?
Count the digits. Timestamps for current dates have 10 digits in seconds (for example 1767225600) and 13 digits in milliseconds (1767225600000). Auto mode in this converter detects which one you pasted.
Get the current timestamp in code
| Language | Code |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Kotlin / Java | System.currentTimeMillis() / 1000 or Instant.now().epochSecond |
| Python | int(time.time()) |
| PHP | time() |
| Swift | Int(Date().timeIntervalSince1970) |
| MySQL | UNIX_TIMESTAMP() |
| Linux / macOS shell | date +%s |
The year 2038 problem
Systems that store timestamps as signed 32-bit integers overflow on 19 January 2038 at 03:14:07 UTC. Modern platforms use 64-bit values, but older databases and embedded devices may still need updating.
Frequently asked questions
How do I convert a Unix timestamp to a date?
Paste the timestamp into the first box. The converter shows the date in UTC, your local time zone and ISO 8601 format.
Is my timestamp in seconds or milliseconds?
Current dates have 10 digits in seconds and 13 digits in milliseconds. Auto mode detects it for you.
How do I get a Unix timestamp for a date?
Pick the date and time in the second box, choose local time or UTC, and copy the seconds or milliseconds value.
Does a Unix timestamp depend on the time zone?
No. A timestamp is the same moment everywhere; only the way it is displayed as a date changes with the time zone.
What is epoch time?
Epoch time is another name for Unix time: the number of seconds since 00:00:00 UTC on 1 January 1970.
Need a website or app built?
We design and build websites and Android apps for clients worldwide – clear scope, fixed price, fast delivery.
Techpass Master Technologies · Websites, Android apps and digital marketing
