How it works
Timestamp to date. The number is read as seconds or milliseconds since 1 January 1970 00:00:00 UTC. Numbers of 100,000,000,000 or more are treated as milliseconds, because in seconds they would be past the year 5000. The date is then shown in UTC, in your device’s time zone, as ISO 8601 (the format used by APIs and databases) and relative to now.
Date to timestamp. Enter a date and time and choose whether it is in your local time zone or in UTC. The same wall-clock time gives different timestamps in different time zones: 12:00 in Madrid and 12:00 in New York are usually six hours apart.
Negative timestamps are dates before 1970: −1 is 31 December 1969 at 23:59:59 UTC.
Notable timestamps
| Timestamp (seconds) | Date and time (UTC) |
|---|---|
| 0 | 1 January 1970, 00:00:00 |
| 1,000,000,000 | 9 September 2001, 01:46:40 |
| 1,700,000,000 | 14 November 2023, 22:13:20 |
| 2,000,000,000 | 18 May 2033, 03:33:20 |
| 2,147,483,647 | 19 January 2038, 03:14:07 (the 32-bit limit) |
Getting the current timestamp in code
| Language | Seconds |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| PHP | time() |
| Java | Instant.now().getEpochSecond() |
| Shell (Linux, macOS) | date +%s |
In JavaScript, Date.now() alone returns milliseconds, which is the most common source of timestamps that are 1,000 times too large.