Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

CURRENT_TIMESTAMP

Example

CURRENT_TIMESTAMP in SQL retrieves the current date and time from the database server.

SELECT CURRENT_TIMESTAMP();

Definition and Usage

The CURRENT_TIMESTAMP() function provides the current date and time.

Note: The output format is either “YYYY-MM-DD HH:MM” (string) or YYYYMMDDHHMMSS.uuuuuu (numeric).

Syntax

CURRENT_TIMESTAMP()

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Return the current date and time plus one.

SELECT CURRENT_TIMESTAMP() + 1;