Function Reference

CURRENT_TIMESTAMP

A synonym for NOW: returns the current date and time.

MySQL 8.4
CURRENT_TIMESTAMP[([fsp])]
  • [ ]optional part
fsp
Number of fractional seconds digits, 0 by default
INTOptional
0123456

Return value

A datetime (DATETIME) as of the start of the query

Examples

Current date and time

MySQL 8.4
SELECT CURRENT_TIMESTAMP;

Milliseconds and a one-day shift

MySQL 8.4
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.

See also

Where to learn