MINUTE Function

Returns the minute from a time or datetime value.

Category: Date and Time
Returned data type: TINYINT

Syntax

MINUTE(time | datetime)

Arguments

time

specifies any valid expression that represents a time value.

Data type TIME
See Overview of Expressions and Predicates

datetime

specifies any valid expression that represents a datetime value.

Data type TIMESTAMP
See Overview of Expressions and Predicates

Details

In Hive, when the MINUTE function is used to search for a specific value, the function will fail if there is more than one column of type TIME in the table.

Example

The following statement illustrates the MINUTE function:
Statements
Results
select minute(endtime) from custonline;
 5
21
 4
25
47
 6
 5
15
35
 6
select minute(current_time);
16
select minute(localtimestamp);
16