How to use the Unix Timestamp Converter
- The current Unix timestamp updates live at the top of the page. Copy it in seconds or milliseconds with one click.
- Type a number in Timestamp → Date to see it in UTC, in ISO 8601 format, in your device's local time and as a relative time such as "3 d ago."
- The unit is picked automatically from the number of digits. You can also set it to seconds or milliseconds yourself.
- In Date → Timestamp, choose a date, a time and a time zone (pick UTC or This device's time zone) to get the value in seconds and milliseconds.
What is a Unix timestamp (epoch time)?
A Unix timestamp is the number of seconds that have passed since 00:00:00 UTC on January 1, 1970, a moment known as the Unix epoch. The value is the same everywhere in the world no matter the time zone, so server logs, databases and API responses use it all the time to store dates.
- 0 → 1970-01-01 00:00:00 UTC
- 1,000,000,000 → 2001-09-09 01:46:40 UTC
- 1,700,000,000 → 2023-11-14 22:13:20 UTC
10-digit vs. 13-digit timestamps
A 10-digit number counts seconds, and a 13-digit number counts milliseconds (thousandths of a second). On Linux, PHP's time() and Python's time.time() usually return seconds. JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds. Divide a millisecond value by 1,000 to get seconds.
| Environment | Get the current timestamp | Unit |
|---|---|---|
| JavaScript | Date.now() | Milliseconds |
| Python | time.time() | Seconds (decimal) |
| Java | System.currentTimeMillis() | Milliseconds |
| Linux shell | date +%s | Seconds |
| MySQL | UNIX_TIMESTAMP() | Seconds |
Converting a timestamp to your local time
A timestamp is always based on UTC. To get local time, add or subtract your offset from UTC. For example, New York is UTC−5 in winter (EST) and UTC−4 in summer (EDT). London is UTC+0 in winter (GMT) and UTC+1 in summer (BST). Sydney is UTC+10 (AEST) or UTC+11 during daylight saving (AEDT). Because of daylight saving time, the offset for the same city depends on the date. The This device row in the converter handles this for you using your browser's time zone settings.
In Excel or Google Sheets, you can turn a timestamp in seconds into a date with =(A1/86400)+DATE(1970,1,1). This divides by the length of a day (86,400 seconds) and adds January 1, 1970, which gives the time in UTC. To shift it to a fixed offset, add hours as a fraction of a day, for example -5/24 for US Eastern Standard Time. Format the cell as a date and time.
What is the Year 2038 problem?
Older systems that store timestamps as signed 32-bit integers can only go up to 2,147,483,647, which is 03:14:07 UTC on January 19, 2038. One second later the value overflows into a negative number and wraps back to December 1901. This is called the Year 2038 problem. Modern operating systems and programming languages use 64-bit integers and don't have this issue.