MySQL: Difference between NOW() and CURDATE()
Question by Compi | Last update on 2024-04-08 | Created on 2016-04-25
In order to get or determine the current date, MySQL is providing the functions NOW() and CURDATE(). You can use this functions for example if you want to compare some column value with the recent date.
However, I am interested in the difference between those functions. In which case should I use which one of those functions and why are there actually two functions for returning the same value in MySQL?
Related Topics
MySQL: Line Breaks in MySQL
Tip | 0 Comments
MySQL: Write current Date or Time into Column
Tutorial | 0 Comments
MySQL: Change minimum word length for full text search
Tip | 1 Comment
MySQL: CSV Export as automatic Download
Tutorial | 0 Comments
MySQL: CSV Export as File stored on the Server
Tutorial | 0 Comments
Android Getting Sound Levels
Open Question | 1 Answer
MySQL: Regular Expressions in MySQL queries
Info | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Indeed, both functions relate to the current date. However, the returned values are nevertheless not the same - so the functions are different even if you do not notice this in some cases. For the sake of completeness, I have added the function CURTIME() to the overview.
So, there is the following relationship:
Which function is appropriate for which purpose depends on whether you only need the date, only the time or both of them.
Last update on 2024-04-08 | Created on 2016-04-26