THE WORLD'S LARGEST WEB DEVELOPER SITE

MySQL CURRENT_TIMESTAMP() Function

❮ MySQL Functions

Example

Return current date and time:

SELECT CURRENT_TIMESTAMP();
Try it Yourself »

Definition and Usage

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

The CURRENT_TIMESTAMP() function will return the current date and time as a:

  • "YYYY-MM-DD HH-MM-SS" format if used in a string context
  • YYYYMMDDHHMMSS format if used in a numeric context in versions of MySQL prior to MySQL 4.1.13
  • YYYYMMDDHHMMSS.uuuuuu format if used in a numeric context in versions of MySQL 4.1.13 and newer

Note: The CURRENT_TIMESTAMP(), LOCALTIME(), and LOCALTIMESTAMP() functions are synonyms for the NOW() function.

Syntax

CURRENT_TIMESTAMP()

Technical Details

Works in: MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

More Examples

Example

Return current date and time + 1:

SELECT CURRENT_TIMESTAMP() + 1;
Try it Yourself »

❮ MySQL Functions