Jump to: navigation, search

Mysql TIME TO SEC

From w3cyberlearnings

Contents

MySQL TIME_TO_SEC Function

This function converts the time input to second.

Syntax TIME_TO_SEC

X is a time value

TIME_TO_SEC(X);

Example 1

mysql> SELECT TIME_TO_SEC('10:30:40');
+-------------------------+
| TIME_TO_SEC('10:30:40') |
+-------------------------+
|                   37840 | 
+-------------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT TIME_TO_SEC('00:00:40');
+-------------------------+
| TIME_TO_SEC('00:00:40') |
+-------------------------+
|                      40 | 
+-------------------------+
1 row in set (0.00 sec)


Related Links



Navigation
Web
SQL
MISC
References