Name

TIME()

Synopsis

TIME(time)

This function returns the time from a given string or column containing date and time data. It’s available as of version 4.1.1 of MySQL. Here is an example:

SELECT NOW( ), As Now,
TIME(NOW( )) AS 'Time only';

+---------------------+-----------+
| Now                 | Time only |
+---------------------+-----------+
| 2008-03-17 00:19:17 | 00:19:17  | 
+---------------------+-----------+

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.