MySQL TIME() Function

MySQL | TIME() Function: Learn about the TIME() function, how it works, its usages, syntax, and examples.
Submitted by Apurva Mathur, on October 12, 2022

TIME() Function

The TIME() is used to extract the time portion from the given expression and displays it as a result.

TIME() Syntax

SELECT TIME(column_name/expression);

TIME() Parameter(s)

You have to provide a date-time value. If you are working on some table then you can also write the column name as a parameter and it will fetch the time from that column name.

TIME() Return Value

As a result, it will display the time part from the date-time value that you are providing as a parameter.

MySQL TIME() Function Example 1

SELECT TIME("2011-06-11 12:14:33");
Example 1: MySQL TIME() Function

MySQL TIME() Function Example 2

SELECT time("10:19:00");
Example 2: MySQL TIME() Function

MySQL TIME() Function Example 3

SELECT time("10:19:00.00012");
Example 2: MySQL TIME() Function



Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.