// timestamp ↔ date · seconds & milliseconds · all timezones · live clock
A Unix timestamp is the number of seconds that have elapsed since January 1, 1970 00:00:00 UTC (the Unix epoch). It's a timezone-independent way to represent a moment in time, widely used in databases, APIs, and programming languages.
Unix timestamps in seconds are 10 digits long (e.g. 1700000000). Millisecond timestamps are 13 digits (e.g. 1700000000000). JavaScript's Date.now() returns milliseconds. Most databases and APIs use seconds.
Unix timestamps (also called Epoch time or POSIX time) represent a moment in time as a single integer — the number of seconds elapsed since January 1, 1970 at 00:00:00 UTC. This simple representation has enormous advantages for programming: timestamps can be compared with a single subtraction, stored in a standard integer field, and are completely timezone-independent.
Date arithmetic becomes trivial with timestamps. Want to find events from the last 7 days? Subtract 604800 (7 × 24 × 60 × 60) from the current timestamp. Want to check if a JWT token has expired? Compare its exp claim to the current timestamp. Want to sort events chronologically? Sort by timestamp numerically.
The timezone-independence is crucial in global applications. If you store a timestamp as a local datetime string, you need to know which timezone it was in to interpret it correctly. A Unix timestamp always refers to a specific absolute moment in UTC, regardless of where the server or user is located.
One of the most common bugs when working with timestamps is mixing seconds and milliseconds. Unix timestamps are traditionally in seconds (10 digits, e.g. 1700000000). JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds (13 digits, e.g. 1700000000000).
Passing milliseconds to a function expecting seconds results in a date 1000 times in the future (around the year 55000). Passing seconds to a function expecting milliseconds results in a date in early 1970. Always check which unit your function expects. This tool automatically detects whether you've pasted a seconds or milliseconds timestamp based on the number of digits.
Math.floor(Date.now()/1000) (seconds) or Date.now() (ms). Python: import time; time.time(). PHP: time(). SQL: UNIX_TIMESTAMP() (MySQL) or EXTRACT(EPOCH FROM NOW()) (PostgreSQL).