Data tool
Epoch Converter
See the current Unix time, turn any epoch timestamp into a readable date, or turn a date into a timestamp.
Runs entirely in your browser. Nothing you paste is uploaded.
Current Unix epoch time
----------
Reading your device clock…
Epoch to date
Date to epoch
How to use the Epoch Converter
- To read a timestamp, paste it under Epoch to date. Seconds, milliseconds, microseconds and nanoseconds are told apart by their length.
- To make a timestamp, pick a date and time under Date to epoch and choose whether it is in your time zone or in UTC.
- Select Copy next to any result to copy it.
What epoch time is and how the converter reads it
Epoch time, also called Unix time or a Unix timestamp, is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. That starting moment is the Unix epoch. Because it is a single number with no time zone attached, the same timestamp means the same instant everywhere, which is why databases, APIs, log files and cookies store time this way.
Systems keep the number at different precision, and the length tells them apart. Today a timestamp in seconds has 10 digits, in milliseconds 13, in microseconds 16 and in nanoseconds 19. JavaScript's Date.now() returns milliseconds, while most Unix tools, PHP's time() and MySQL's UNIX_TIMESTAMP() return seconds. The converter picks the unit from the length, and you can set it yourself when a value could be read two ways.
The result is shown in UTC, in your own time zone as set on your device, and as an ISO 8601 string, the format most APIs accept. Going the other way, a date and time become a timestamp in seconds and in milliseconds, along with the first and last second of that day, which is what a date-range query needs.
The year 2038 problem affects systems that keep the timestamp in a signed 32-bit integer. The largest value such a field can hold is 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later the number overflows. Systems that use 64-bit integers are not affected.
Epoch time in code
How to get the current epoch time in seconds, and how to turn a timestamp back into a date, in the languages and databases people ask about most. The examples use 1800000000, which is 15 January 2027, 08:00:00 UTC.
| Language | Current epoch time | Timestamp to date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(1800000000 * 1000).toISOString() |
| Python | import time; int(time.time()) | datetime.fromtimestamp(1800000000, tz=timezone.utc) |
| PHP | time() | gmdate('Y-m-d H:i:s', 1800000000) |
| Java | Instant.now().getEpochSecond() | Instant.ofEpochSecond(1800000000L) |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() | DateTimeOffset.FromUnixTimeSeconds(1800000000) |
| Go | time.Now().Unix() | time.Unix(1800000000, 0).UTC() |
| Ruby | Time.now.to_i | Time.at(1800000000).utc |
| Linux shell | date +%s | date -u -d @1800000000 |
| macOS shell | date +%s | date -u -r 1800000000 |
| MySQL | SELECT UNIX_TIMESTAMP(); | SELECT FROM_UNIXTIME(1800000000); |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM now())::bigint; | SELECT to_timestamp(1800000000); |
| SQLite | SELECT strftime('%s', 'now'); | SELECT datetime(1800000000, 'unixepoch'); |
| Excel and Google Sheets | =(NOW()-DATE(1970,1,1))*86400 | =A1/86400+DATE(1970,1,1) |
JavaScript and Java work in milliseconds by default, so multiply a timestamp in seconds by 1000 before making a date from it. The spreadsheet formulas use the sheet's own time zone: NOW() is local time, so the first formula is exact only when the sheet is set to UTC.
Common lengths of time in seconds
| Length of time | Seconds | Milliseconds |
|---|---|---|
| 1 minute | 60 | 60000 |
| 1 hour | 3600 | 3600000 |
| 1 day | 86400 | 86400000 |
| 1 week | 604800 | 604800000 |
| 30 days | 2592000 | 2592000000 |
| 365 days | 31536000 | 31536000000 |
Timestamps worth knowing
| Timestamp | Date in UTC | Why it matters |
|---|---|---|
0 | 1 Jan 1970, 00:00:00 | The Unix epoch itself |
1000000000 | 9 Sep 2001, 01:46:40 | The first 10-digit timestamp |
1234567890 | 13 Feb 2009, 23:31:30 | The digits run in order |
2000000000 | 18 May 2033, 03:33:20 | The next round billion |
2147483647 | 19 Jan 2038, 03:14:07 | The largest signed 32-bit value |
Common questions
How do I convert a Unix timestamp to a date?
Paste the timestamp under Epoch to date. The converter shows the date in UTC, in your own time zone and as an ISO 8601 string.
What is an epoch timestamp?
It is the number of seconds since 00:00:00 UTC on 1 January 1970. The same number describes the same instant in every time zone.
How do I know if a timestamp is in seconds or milliseconds?
Count the digits. A current timestamp in seconds has 10 digits and one in milliseconds has 13. The converter reads the length and tells you which unit it used.
Does an epoch timestamp have a time zone?
No. It always counts from midnight UTC. A time zone only matters when the number is shown as a date, so the converter shows both UTC and your local time.
Why is my date off by a few hours?
The timestamp was probably made from a local time but read as UTC, or the other way round. Check the Read as setting under Date to epoch, and compare the UTC and local lines in the result.
Can it convert dates before 1970?
Yes. Dates before 1 January 1970 have negative timestamps. Enter a negative number, or pick an earlier date.
What is the year 2038 problem?
A signed 32-bit integer cannot count past 2,147,483,647 seconds, which is reached at 03:14:07 UTC on 19 January 2038. Software that still stores time that way will misread dates after that moment.
Are my timestamps sent anywhere?
No. The conversion runs in your browser, using your device's clock and time zone.