TIME and TIME_TO_SEC Function in MariaDB Last Updated : 14 Dec, 2020 Comments Improve Suggest changes Like Article Like Report 1. TIME Function : In MariaDB, The TIME Function returns the time portion of a DateTime expression. In this function, the first parameter will be the DateTime. This function returns the time given a DateTime. In this function, we will pass the DateTime expression in it and it will return the time of the DateTime expression as result. if the expression is not a time or a DateTime value, the TIME function will return '00:00:00'. If the expression is NULL, the TIME function will return NULL. Syntax : TIME( expression ) Parameter : Datetime expression -The time value from which the time should be extracted. Return : It will return the time portion of a DateTime expression. Example-1 : SELECT TIME('2020-10-16 06:18:01.000001'); Output : '06:18:01.000001' Example-2 : SELECT TIME('10:35:05'); Output : 10:35:05 Example-3 : SELECT TIME(NULL); Output : NULL 2. TIME_TO_SEC Function : In MariaDB, TIME_TO_SEC Function is used to convert a time value into numeric seconds. In this function, the first parameter will be time. And this function will return The time value to convert to numeric seconds. It works opposite to the SEC_TO_TIME function. Syntax : TIME_TO_SEC( time ) Parameters : Time -The time value to convert to numeric seconds. Return : Return the time in numeric seconds. Example-1 : SELECT TIME_TO_SEC('00:00:02'); Output : 2 Example-2 : SELECT TIME_TO_SEC('00:00:01.999999'); Output : 1 Example-3 : SELECT TIME_TO_SEC('-12:30:59'); Output : -45059 Comment More infoAdvertise with us Next Article TIME and TIME_TO_SEC Function in MariaDB vipinyadav15799 Follow Improve Article Tags : SQL DBMS-SQL Similar Reads Sin(), Cos() and Tan() Function in MariaDB 1. Sin() Function : In MariaDB, SIN() function is used to returns the sine of a number. In this function, a number will be passed as a parameter and this function will return the sine of that number. The number used to calculate the sine. It is expressed in radians. Syntax : SIN(number) Parameter : 2 min read SEC_TO_TIME() Function in MySQL SEC_TO_TIME() function : This function in MySQL is used to return a time value based on the specified seconds value. Here the returned time value will be in the format of HH:MM:SS. For example, if the specified second value is 63, this function will return "00:01:03". Syntax : SEC_TO_TIME(seconds) P 1 min read QUARTER () and SEC_TO_TIME () in MariaDB 1. QUARTER Function : In MariaDB, The QUARTER Function returns the quarter portion of a date value. In this function, the first parameter will be the date/DateTime. This function returns the quarter (a number from 1 to 4) given a date value. Dates that have a month of Jan-Mar would return 1, for the 2 min read MID(), POSITION() and LENGTH() Function in MariaDB 1. MID() Function : In MariaDB, the MID() Function is used to extract a substring from a string. It will return a substring of a given length from the starting point. If the starting position is a positive number, then it will start from the starting index. If negative, then it will start from the e 2 min read SECOND Function and SYSDATE Function in MariaDB 1. SECOND Function : In MariaDB, The SECOND Function returns the second portion of a date value. In this function, the first parameter will be the date/DateTime. This function returns the seconds (a number from 0 to 59) given a date value. In this function, we will pass the date value in it and it w 2 min read Like