Name

SECOND()

Synopsis

SECOND(time)

This function returns the seconds value (0–59) for a given time. Here is an example:

SELECT NOW( ), SECOND(NOW( ));

+---------------------+----------------+
| NOW( )              | SECOND(NOW( )) |
+---------------------+----------------+
| 2009-05-09 14:56:11 |             11 |
+---------------------+----------------+

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

Get MySQL in a Nutshell, 2nd Edition 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.