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

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;