[MySQL] Get the current Unix timestamp

Created on November 30, 2026

Call UNIX_TIMESTAMP() with no arguments to get the current Unix timestamp in seconds. The result depends on when you run the query.

SELECT UNIX_TIMESTAMP();

For example, the result could be 1666516615.

MySQL