Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

LOCALTIME

Example

Retrieve the current date and time.

SELECT LOCALTIME();

Definition and Usage

The LOCALTIME() function retrieves the current date and time.

Note: The date and time are returned either as “YYYY-MM-DD HH-MM-SS” (string) or as YYYYMMDDHHMMSS.uuuuuu (numeric).

Syntax

LOCALTIME()

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Return the current date and time plus 1.

SELECT LOCALTIME() + 1;