<Date and Time Functions>
SELECT DATE_FORMAT('2021-05-04 20:23:01', '%Y-%m-%d.');
=> '2021-05-04'
SELECT DATE_FORMAT('2021-05-04 20:23:01', '%H:%i:%s');
=> '20:23:01'
SELECT DATE_FORMAT(DeviceReportedTime, '%Y-%m-%d %H:%i:%s') AS date, Facility, Priority, FromHost, FromIP, Message FROM SystemEvents WHERE DeviceReportedTime BETWEEN '2021-12-16 00:00:00' AND
'2021-12-16 23:59:59' ORDER BY DeviceReportedTime DESC;
=> 'date' : '2021-12-16 13:43:49'
더 자세한 내용은 아래 문서를 통해 확인할 수 있다.
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html