MINUTE
Descriptionβ
Extracts the minute part from a datetime value. The returned value ranges from 0 to 59.
Syntaxβ
MINUTE(<datetime>)
Parametersβ
Parameter | Description |
---|---|
<datetime> | The input datetime value, which can be of type DATE, DATETIME, DATETIMEV2, or TIME |
Return Valueβ
Returns an INT type representing the minute value, with a range of 0-59.
Exampleβ
SELECT MINUTE('2018-12-31 23:59:59');
+------------------------------------------------------+
| minute(cast('2018-12-31 23:59:59' as DATETIMEV2(0))) |
+------------------------------------------------------+
| 59 |
+------------------------------------------------------+
Note:
- The input parameter can be of various time-related types.
- The returned value is always an integer between 0 and 59.
- If the input parameter is NULL, the function returns NULL.