MAKETIME(hour,minute,second)
Returns a time value calculated from the hour
, minute
, and second
arguments.
If minute
or second
are out of the range 0 to 60, NULL is returned. The hour
can be in the range -838 to 838, outside of which the value is truncated with a warning.
SELECT MAKETIME(13,57,33); +--------------------+ | MAKETIME(13,57,33) | +--------------------+ | 13:57:33 | +--------------------+ SELECT MAKETIME(-13,57,33); +---------------------+ | MAKETIME(-13,57,33) | +---------------------+ | -13:57:33 | +---------------------+ SELECT MAKETIME(13,67,33); +--------------------+ | MAKETIME(13,67,33) | +--------------------+ | NULL | +--------------------+ SELECT MAKETIME(-1000,57,33); +-----------------------+ | MAKETIME(-1000,57,33) | +-----------------------+ | -838:59:59 | +-----------------------+ 1 row in set, 1 warning (0.00 sec) SHOW WARNINGS; +---------+------+-----------------------------------------------+ | Level | Code | Message | +---------+------+-----------------------------------------------+ | Warning | 1292 | Truncated incorrect time value: '-1000:57:33' | +---------+------+-----------------------------------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/maketime/