Name

MINUTE( )

Synopsis

MINUTE(time)

This function returns the minute value (0-59) of a given time.

SELECT CONCAT(HOUR(appointment), ':',
       MINUTE(appointment)) AS 'Appointment'
   FROM appointments
   WHERE client_id = '3992'
      AND appointment > CURDATE( );
+-------------+
| Appointment |
+-------------+
|       13:30 |
+-------------+

This statement is using the string function CONCAT() to paste together the hour and the minute, with a colon as a separator.

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.