MySQL Minute Function

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

MINUTE(Time or DateTime expression);

MySQL Minute function Example

The following examples help you understand the use of Minute method. Here, we are printing 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');
Example 1

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

SELECT MINUTE(NOW());

SELECT MINUTE(UTC_TIMESTAMP());

SELECT MINUTE(UTC_TIME());
Example 2

Minute Example 2

The following 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');
Example 3

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

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