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

NOW

Example

Retrieve the current date and time.

SELECT NOW();

Definition and Usage

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

Please note that the date and time are returned in either “YYYY-MM-DD HH-MM-SS” (string) or YYYYMMDDHHMMSS.uuuuuu (numeric) format.

Syntax

NOW()

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Retrieve the current date and time incremented by 1 unit.

SELECT NOW() + 1;