I want to update the datetime round to 15 minutes in a MYSQL database table.
If the dateTime is
The answer you have seen is quite useful, try this
SELECT SUBSTRING_INDEX(datetime_field, ' ', -1) AS old_time,SEC_TO_TIME((TIME_TO_SEC(datetime_field) DIV 900) * 900) AS rounded_time, datetime_field FROM yourtable
You can get time from the datetime_field as substring and replace it with the rounded time.
if you want to update the datetime you can reply it and update it with update function
UPDATE yourtable SET `datetime_field` = REPLACE(datetime_filed,SUBSTRING_INDEX(datetime_field, ' ', -1),SEC_TO_TIME((TIME_TO_SEC(datetime_field) DIV 900) * 900))
I hope that helps...