MySQL MINUTE() Function; In this tutorial, i am going to show you Minute() function of MySQL with the help of examples.
MySQL Minute() Function
The MySQL MINUTE() function is used for return the minute part of a datetime value. It can be between 0 to 59. When the datetime is passed in MINUTE() function then it will return the minute value
Syntax of MySQL Minute() Function
The syntax for the MINUTE function is:
MINUTE( datetimevalue )
Example 1 – MySQL Minute() Function
Let’s take an example using MySQL MINUTE() function; as follows:
SELECT MINUTE('11:40:30');
Output-1
+-------------------+ |MINUTE('11:40:30') | +-------------------+ | 40 | +------------------ +
Example 2 – MySQL Minute() with Now() Function
Let’s take an example using MySQL Minute() with NOW() function; as follows:
SELECT MINUTE(NOW());
Output-2
+--------------------+ | MINUTE(NOW) | +--------------------+ | 37 | +--------------------+
Example 3 – MySQL Minute() Function
Let’s take an example using MySQL Minute() with CURTIME() function; as follows:
SELECT MINUTE(CURTIME());
Output-3
+--------------------+ | MINUTE(CURTIME()) | +--------------------+ | 37 | +--------------------+
Conclusion
MySQL Minute() Function tutorial, you have learned how to use MySQL Minute() function with examples.