MINUTE
MINUTE(time);
Section titled “MINUTE(time);”- time: This is the time value from which the minute value will be extracted. The ‘time’ input should be in a format that MySQL can recognize as a valid time or datetime type value. The MINUTE() function will then return the minute component of that time value, ranging from 0 to 59.
Example
Section titled “Example”SELECT MINUTE('2022-03-30 14:25:45');Output
Section titled “Output”25Explanation
Section titled “Explanation”The MINUTE function in MySQL extracts the minute from a given time or datetime value. In the example, it extracts ‘25’ as the minute from ‘2022-03-30 14:25:45’.
MINUTE(timestamp TIMESTAMPTZ) RETURNS INT
Section titled “MINUTE(timestamp TIMESTAMPTZ) RETURNS INT”- timestamp timestamptz: This parameter represents a timestamp with time zone. This timestamp value is the input from which the function will extract the minute.
- returns int: This parameter signifies the function’s return type. Upon completion, the MINUTE function will yield an integer representing the minute component of the provided timestamp.
Example
Section titled “Example”SELECT EXTRACT(MINUTE FROM TIMESTAMP '2022-02-22 20:30:00');Output
Section titled “Output”30Explanation
Section titled “Explanation”The EXTRACT(MINUTE FROM TIMESTAMP) function returns the minute from the provided timestamp. In this example, it returned ‘30’ as the minute value from the timestamp ‘2022-02-22 20:30:00’.
MINUTE(date)
Section titled “MINUTE(date)”- date: The date is the expression which specifies the date that SQL Server uses to return the minute part. The expression can be an argument that allows a date type such as a datetime, date, datetime2, smalldatetime, datetimeoffset, or a character string in the format ‘YYYY-MM-DD HH
Example
Section titled “Example”SELECT MINUTE('2022-06-20T14:25:10') AS MinuteValue;Output
Section titled “Output”MinuteValue-----------25Explanation
Section titled “Explanation”The MINUTE function in SQL is used to extract the minute from a given date-time value. In the above example, the function is extracting the minute ‘25’ from the provided date-time string ‘2022-06-20T14:25:10’.
MINUTE(date)
Section titled “MINUTE(date)”- date: The date or datetime expression from which the minute value is to be extracted. It’s a valid entry in the field, whether it’s a column or a string literal containing a date.
Example
Section titled “Example”SELECT MINUTE(TO_DATE('12:30:25', 'HH24:MI:SS')) FROM dual;Output
Section titled “Output”30Explanation
Section titled “Explanation”The MINUTE function is used to extract the minute component from a given time. In the provided example, the input time string ‘12:30:25’ is converted into a date format ‘HH24:MI:SS’, and then the minute ‘30’ is extracted.
MINUTE(datetime)
Section titled “MINUTE(datetime)”- datetime: This is the input parameter to the MINUTE() function. It specifies the datetime value from which you want to extract the minute. This parameter needs to follow a recognizable datetime format.
Example
Section titled “Example”SELECT MINUTE('2021-12-24 14:30:00');Output
Section titled “Output”30Explanation
Section titled “Explanation”The MINUTE() function in this example returns the minute from the given timestamp, which is ‘30’.