Mysql Time Function
MySQL: TIME Function
This tutorial explains how to use the MySQL TIME function with syntax and examples.
Description
The MySQL TIME function extracts the time value from a time/datetime expression.
Syntax
The syntax for the TIME function in MySQL is:
Parameters or Arguments
- expression
The time or datetime value from which the time should be extracted.
Note
- If expression is not a time or a datetime value, the TIME function will return '00:00:00'.
- If expression is NULL, the TIME function will return NULL.
- See also the CAST function.
Applies To
The TIME function can be used in the following versions of MySQL:
- MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1.1
Example
Let's look at some MySQL TIME function examples and explore how to use the TIME function in MySQL.
For example: