Get Current Unix Timestamp in Popular Languages
| Language / Environment | Code Snippet (Seconds) |
|---|---|
| JavaScript / Node.js | Math.floor(Date.now() / 1000) |
| Python | import time; int(time.time()) |
| PHP | time() |
| PostgreSQL / MySQL | SELECT EXTRACT(EPOCH FROM NOW()); / UNIX_TIMESTAMP() |
Frequently Asked Questions
What is a Unix timestamp (Epoch time)?
A Unix timestamp is the total number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC (the Unix Epoch), not counting leap seconds.
How do I tell if a timestamp is in seconds or milliseconds?
Current Unix timestamps in seconds have 10 digits (e.g., 1763274240), whereas JavaScript Date.now() millisecond timestamps have 13 digits (e.g., 1763274240000). This tool automatically detects both.
What is the Year 2038 problem?
Systems storing Unix timestamps as signed 32-bit integers will overflow on January 19, 2038 at 03:14:07 UTC. Modern 64-bit systems resolve this limit for billions of years.