time_to_sec

description

Syntax

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.

example

1. mysql >select current_time(),time_to_sec(current_time());
2. +----------------+-----------------------------+
3. | current_time() | time_to_sec(current_time()) |
4. +----------------+-----------------------------+
5. | 16:32:18       |                       59538 |
6. +----------------+-----------------------------+
7. 1 row in set (0.01 sec)

keywords

1. TIME_TO_SEC