The function returns the second part of the specified datetime value. The range of seconds is 0 to 59.
SECOND(<datetime>)
| Parameter | Description |
|---|---|
<datetime> | The input date or datetime value. Supports DATE or DATETIME types. |
select second('2018-12-31 23:59:59');
+---------------------------------------------+ | second(cast('2018-12-30' as DATETIMEV2(0))) | +---------------------------------------------+ | 0 | +---------------------------------------------+