SEC_TO_TIME()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the time value derived from the number of seconds since midnight.
USAGE
SEC_TO_TIME(seconds)
Argument Name | Description |
---|---|
| The number of seconds since midnight |
DETAILS
SEC_TO_TIME()
is a date-time function that returns a time value derived from the seconds
argument (the number of seconds since midnight).
The return value is in the format hh:mm:ss
.
The number of hours returned can exceed 23, with the maximum return value being 838:59:59
. This return value corresponds to a seconds
value of 3020399.
A NULL
is returned if the argument is NULL
.
For the opposite conversion, see TIME_
EXAMPLES
SELECT SEC_TO_TIME(1234);
+-------------------+
| SEC_TO_TIME(1234) |
+-------------------+
| 00:20:34.000000 |
+-------------------+
SELECT SEC_TO_TIME(3020399);
+----------------------+
| SEC_TO_TIME(3020399) |
+----------------------+
| 838:59:59.000000 |
+----------------------+