What is the difference between curdate()
and current_date
in MySQL?
Current_date() will only give you the date. now() give you the datetime when the statement,procedure etc... started.
1 Answer. CURDATE() returns the current date whereas DATE() extracts the date part or datetime expression.
MySQL CURDATE() Function The CURDATE() function returns the current date. Note: The date is returned as "YYYY-MM-DD" (string) or as YYYYMMDD (numeric). Note: This function equals the CURRENT_DATE() function.
NOW() it produce date and time both in current scenario whereas CURDATE() produce date only, CURTIME() display time only, we can use one of them according to our need with CAST or merge other calculation it, MySQL rich in these type of function.
There's no difference. It says it right there in the manual:
CURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With