Get the current timestamp
| Bash | date +%s |
| Bash โ date | date -d @1700000000 (GNU) / date -r 1700000000 (macOS) |
| PHP | time() / now()->timestamp (Laravel) |
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| MySQL / MariaDB | SELECT UNIX_TIMESTAMP(); / FROM_UNIXTIME(ts) |
| PostgreSQL | SELECT extract(epoch FROM now()); |
Seconds vs milliseconds
Unix time counts seconds since 1970-01-01 00:00:00 UTC. A 10-digit number is seconds; a 13-digit number is milliseconds (JavaScript, Java). This tool detects the unit automatically.
The year 2038 problem
Signed 32-bit timestamps overflow at 2147483647 โ 2038-01-19 03:14:07 UTC. Check old embedded systems and INT database columns; use 64-bit types.