Jump to: navigation, search

Mysql SEC TO TIME

From w3cyberlearnings

Contents

MySQL SEC_TO_TIME Function

This function converts the second input to time.

Syntax SEC_TO_TIME

  • Second: second input
SEC_TO_TIME(second);

Example 1

mysql> SELECT SEC_TO_TIME(500);
+------------------+
| SEC_TO_TIME(500) |
+------------------+
| 00:08:20         |
+------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT SEC_TO_TIME(8600);
+-------------------+
| SEC_TO_TIME(8600) |
+-------------------+
| 02:23:20          |
+-------------------+
1 row in set (0.00 sec)

Example 3

mysql> SELECT SEC_TO_TIME(8600)+0;
+---------------------+
| SEC_TO_TIME(8600)+0 |
+---------------------+
|        22320.000000 |
+---------------------+
1 row in set (0.00 sec)

Related Links



Navigation
Web
SQL
MISC
References