SELECT a.user_id, a.date , DATE_FORMAT(DATE_ADD(a.date,INTERVAL 30 MINUTE),‘%Y-%m-%d %H:%i’) AS date2, u.username FROM ( SELECT DATE_FORMAT( CONCAT( DATE( created_time ), ’ , HOUR ( created_time ), ‘:’, floor( MINUTE ( created_time )/ 30 ) * 30 ), ‘%…