time_to_sec

description

Syntax

INT time_to_sec(TIME datetime)

参数为Datetime类型 将指定的时间值转为秒数,即返回结果为:小时×3600 + 分钟×60 + 秒。

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