MySQL Minute Function

MySQL Minute function is one of the Date Functions, which returns the Minute value from the given time. This Minute function returns a value from 0 to 59. The syntax of the Minute Function in MySQL is as shown below:

MINUTE(Time or DateTime expression);

MySQL Minute function Example

The following examples help you understand the use of Minute function. Here, we are returning the Minute from time and DateTime expressions.

SELECT MINUTE('12:35:44');

SELECT MINUTE('2019-11-13 12:35:44');

SELECT MINUTE('2019-11-19 12:11:44.111234');
MySQL MINUTE Function 1

Let us see another example of the Minute function. Here, we are using NOW, UTC_TIME, and UTC_TIMESTAMP inside this Minute function to return the Minutes from the current date and time.

SELECT MINUTE(NOW());

SELECT MINUTE(UTC_TIMESTAMP());

SELECT MINUTE(UTC_TIME());
MySQL MINUTE Function 2

MySQL Minute Function Example 2

The following Date Function queries show you what happens when we try to return the minute from string DateTime, wrong time, or 0 as the time value.

SELECT MINUTE(NOW() + 12);

SELECT MINUTE('10:65:44');

SELECT MINUTE('00:56:44');
MySQL MINUTE Function 3

Minute Example 3

This example shows you how to use this Minute function on table data. Here, we are finding or returning Minutes from the Hire Date column. For this MySQL function demo, we are using Workbench to write a query against the customer database.

SELECT EmpID,
FirstName,
LastName,
Occupation,
YearlyIncome,
Sales,
HireDate,
MINUTE(HireDate)
FROM `MySQL Tutorial`.customer;
MySQL MINUTE Function 4