跳到主要内容

toSecond

Converts a date with time to a UInt8 number containing the number of the second in the minute (0-59).

Syntax

toSecond( <expr> )

Arguments

ArgumentsDescription
<expr>datetime

Return Type

UInt8 datatype.

Examples

SELECT toSecond(now());
+-----------------+
| toSecond(now()) |
+-----------------+
| 14 |
+-----------------+

SELECT toSecond(to_datetime(1630812366));
+----------------------------------+
| toSecond(to_datetime(1630812366)) |
+----------------------------------+
| 6 |
+----------------------------------+