Skip to main content

TO_MINUTE

Converts a date with time (timestamp/datetime) to a UInt8 number containing the number of the minute of the hour (0-59).

Syntax

TO_MINUTE(<expr>)

Arguments

ArgumentsDescription
<expr>timestamp

Return Type

TINYINT

Examples

SELECT to_minute(now());
+------------------+
| to_minute(now()) |
+------------------+
| 17 |
+------------------+

SELECT to_minute(to_timestamp(1630812366));
+-------------------------------------+
| to_minute(to_timestamp(1630812366)) |
+-------------------------------------+
| 26 |
+-------------------------------------+