bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL TIME() Function

Concept visual

MySQL TIME() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Extract the time part from a time expression: SELECT TIME("19:30:10");

Definition and Usage

Formula

The TIME() function extracts the time part from a given time/datetime.

Note:

Formula

This function returns "00:00:00" if expression is not a datetime/time, or NULL if expression is NULL.

Syntax

Time(

expression )

Parameter Values

Parameter

Description expression

Formula

Required. The time/datetime to extract the time from

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Extract the time part from the datetime expression: SELECT TIME("2017-08-15 19:30:10");

Example

Extract the time part from the datetime expression: SELECT TIME("2017-08-15 19:30:10.000001");

Example

Extract the time part from NULL:

SELECT TIME(NULL);

Previous

❮ MySQL Functions

Next

Previous

MySQL SYSDATE() Function

Next

MySQL TIME_FORMAT() Function