EN
MySQL - SECOND() function example
0
points
In this article, we would like to show you SECOND() function example in MySQL.
Syntax:
SELECT SECOND('YYYY-MM-DD hh:mm:ss');
Where:
YYYY- four-digit year format, e.g.2021,MM- month number (counted from01to12),DD- day number (from01to31- depending on the month),hh- hour number (from00to24),mm- minute number (from00to59),ss- second number (from00to59).
Practical example
In this example, we will use SECOND() function to display only a second from a DATETIME value.
Query:
SELECT SECOND('2021-01-01 11:41:31');
Result: