hakeem777 Posted August 4, 2010 Share Posted August 4, 2010 I understand after running now() function in an SQL statement, I will get current date/time like following in mysql browser: '2010-08-04 17:01:06' If I want the returned value to be '2010-08-04 00:00:00'. How can I do? Thanks. Link to comment https://forums.phpfreaks.com/topic/209754-remove-the-timestamp-in-now/ Share on other sites More sharing options...
bh Posted August 4, 2010 Share Posted August 4, 2010 Hi, You can use DATE_FORMAT(date, format). Eg. like this: SELECT DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00'); Link to comment https://forums.phpfreaks.com/topic/209754-remove-the-timestamp-in-now/#findComment-1094990 Share on other sites More sharing options...
Mchl Posted August 4, 2010 Share Posted August 4, 2010 CURDATE() Link to comment https://forums.phpfreaks.com/topic/209754-remove-the-timestamp-in-now/#findComment-1095047 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.