How to Get the Current Date in MySQL Database: MySQL Operators: CURDATE() Table of Contents Problem Solution Discussion Problem You’d like to get the current date in MySQL. Solution Use the CURDATE() function. Here’s the query: SELECT CURDATE(); Here’s the result of the query: 2024-11-03 Discussion Use the CURDATE() function to get the current date. The date can be displayed in two different formats: 'YYYY-MM-DD' (if it is used as a string) or YYYYMMDD (if it is used as a numeric). What does it mean to be used in a string or numeric context? Let’s see an example of a query in a string context: SELECT CURDATE(); And the result: 2024-11-03 An example of a query in a numeric context: SELECT CURDATE() + 0; Which will result in: 20241103 There are two other functions that can be used instead of CURDATE(): CURRENT_DATE and CURRENT_DATE(). All three are synonyms; that is, you can choose any of them and the result will be the same. Recommended courses: SQL Basics in MySQL Common MySQL Functions SQL Practice Set in MySQL Recommended articles: MySQL Cheat Sheet 18 Useful Important SQL Functions to Learn ASAP Performing Calculations on Date- and Time-Related Values SQL Date and Interval Arithmetic: Employee Lateness MySQL Date Functions: Complete Analyst’s Guide MySQL Practice: Best Exercises for Beginners See also: How to Get the Current Date and Time in MySQL How to Find the Number of Days Between Two Dates in MySQL How to Find the Last Day of a Month in MySQL How to Change Seconds to a Time Value in MySQL How to Change Datetime Formats in MySQL