This tutorial explains how to use the MySQL MINUTE function with syntax and examples.
The MySQL MINUTE function returns the minute portion of a date value.
The syntax for the MINUTE function in MySQL is:
MINUTE( date_value )
A time or datetime value from which to extract the minute.
The MINUTE function can be used in the following versions of MySQL:
Let's look at some MySQL MINUTE function examples and explore how to use the MINUTE function in MySQL.
For example:
mysql> SELECT MINUTE('2014-01-28 07:47:18.000004');
Output: 47
mysql> SELECT MINUTE('2014-01-28 15:21:05');
Output: 21
mysql> SELECT MINUTE('12:13:06');
Output: 13
mysql> SELECT MINUTE('838:11:59');
Output: 11
This last MINUTE example would display the minute portion of the current system time (current system time is returned by the CURTIME function).
mysql> SELECT MINUTE(CURTIME());