INT time_to_sec(TIME datetime)
input parameter is the time type Convert the specified time value to seconds, returned result is: hours × 3600+ minutes×60 + seconds.
mysql >select current_time(),time_to_sec(current_time()); +----------------+-----------------------------+ | current_time() | time_to_sec(current_time()) | +----------------+-----------------------------+ | 16:32:18 | 59538 | +----------------+-----------------------------+ 1 row in set (0.01 sec)
TIME_TO_SEC