About epoch / unix timestamp converter
A Unix timestamp counts the seconds that have passed since 1 January 1970 00:00:00 UTC. Programs use it because a single number is easy to store, compare and sort.
Seconds or milliseconds
- A 10-digit value such as 1700000000 is in seconds.
- A 13-digit value such as 1700000000000 is in milliseconds, used by JavaScript.
- Mixing them up gives dates in 1970 or in the far future, a common bug.
Time zones
A timestamp itself has no time zone. It marks one moment in time, which you can display in any zone. The same number shows different clock times in Mumbai and London.
A worked example
The timestamp 1700000000 is 14 November 2023 at 22:13:20 UTC, which is 3:43:20 AM on 15 November in India. The start of 2026 (1 January 2026, 00:00 UTC) is 1767225600. Multiply by 1,000 for the millisecond form used by JavaScript.
Common bugs
- Treating seconds as milliseconds, which gives a date in January 1970.
- Storing local time instead of UTC, which breaks when users travel or clocks change.
- 32-bit systems overflow in January 2038, so use 64-bit timestamps in new systems.
