Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

LOCALTIMESTAMP

Example

Retrieve the current date and time.

SELECT LOCALTIMESTAMP();

Definition and Usage

The LOCALTIMESTAMP() 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

LOCALTIMESTAMP()

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Retrieve the current date and time incremented by 1.

SELECT LOCALTIMESTAMP() + 1;