CURRENT_TIMESTAMP
A synonym for NOW: returns the current date and time.
MySQL 8.1
CURRENT_TIMESTAMP[([fsp])]Parameters
- fspINToptional
- Number of fractional seconds digits from 0 to 6, 0 by default
Return value
A datetime (DATETIME) as of the start of the query
Examples
Current date and time
MySQL 8.1
SELECT CURRENT_TIMESTAMP;Milliseconds and a one-day shift
MySQL 8.1
SELECT CURRENT_TIMESTAMP(3) AS with_ms,
CURRENT_TIMESTAMP + INTERVAL 1 DAY AS tomorrow;Details
The parentheses are optional: CURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are the same. This form is handy as a column default value: created_at DATETIME DEFAULT CURRENT_TIMESTAMP.