Name

SECOND( )

Synopsis

SECOND(time)

This function returns seconds value (0-59) for a given time.

SELECT NOW( ), SECOND(NOW( ));
+---------------------+---------------+
| NOW( )               | SECOND(NOW( ))  |
+---------------------+---------------+
| 2004-05-09 14:56:11 |            11 |
+---------------------+---------------+

The first column generated shows the time that this statement was entered, using NOW( ) function. The second column displays only the seconds value for the results of NOW( ).

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.