SQL CURDATE()

Anonymous contributor's avatar
Anonymous contributor
Published Oct 2, 2024
Contribute to Docs

The CURDATE() function returns the current date in the format YYYY-MM-DD unlike DATETIME() which returns the date as well as time.

  • Learn to analyze data with SQL and prepare for technical interviews.
    • Includes 9 Courses
    • With Certificate
    • Beginner Friendly.
      17 hours
  • In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Beginner Friendly.
      5 hours

Syntax

CURDATE()

Example

The below example shows how curdate functions work:

SELECT CURDATE();

Output of the above code is:

2024-09-23

All contributors

Contribute to Docs

Learn SQL on Codecademy

  • Learn to analyze data with SQL and prepare for technical interviews.
    • Includes 9 Courses
    • With Certificate
    • Beginner Friendly.
      17 hours
  • In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Beginner Friendly.
      5 hours