MySQL: MINUTE Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL MINUTE Function

In this guide, we will explain how to use the MySQL MINUTE function with syntax and examples.

Description

The MySQL MINUTE function returns the minute portion of a date value.

Syntax

The syntax for the MINUTE function is:

MINUTE( date_value )

Parameters or Arguments

date_value

A time or datetime value from which to extract the minute.

Note

  • The MINUTE function returns the minute (a number from 0 to 59) given a date value.
  • See also the EXTRACTYEARQUARTERMONTHWEEKDAYHOURSECOND, and MICROSECOND functions.

Applies To

The MINUTE function can be used in the following versions :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let’s look at some MINUTE function examples and explore how to use the MINUTE function.

For example:

mysql> SELECT MINUTE('2014-01-28 07:47:18.000004');
Result: 47

mysql> SELECT MINUTE('2014-01-28 15:21:05');
Result: 21

mysql> SELECT MINUTE('12:13:06');
Result: 13

mysql> SELECT MINUTE('838:11:59');
Result: 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());

Next Topic : Click Here

This Post Has One Comment

Leave a Reply