Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

MySQL MAKETIME Function

MySQL MAKETIME function is one of the MySQL Date Functions, which is useful to calculate or get time from the hour, minute, second arguments given by us.

In this article, we show you how to use this MySQL Make time function to get or calculate time with an example. The basic syntax of the Maketime() Function in MySQL is as shown below:

MAKETIME(hour, minutes, seconds);

MySQL Maketime function Example

These examples help you understand the use of this MySQL Maketime function. Here, we are trying to get or calculate the time based on the hours, minutes, and seconds of three different values.

SELECT MAKETIME(11, 10, 25);

SELECT MAKETIME(12, 45, 55);

SELECT MAKETIME(23, 45, 59);
MySQL MAKETIME Function 1

Let us see another example of MySQL Maketime function. Here, we are trying to calculate the time from invalid MySQL argument values.

SELECT MAKETIME(23, 45, 75);

SELECT MAKETIME(23, 77, 59);

SELECT MAKETIME(HOUR(NOW()), MINUTE(NOW()), SECOND(NOW()));
MySQL MAKETIME Function 2

From the above screenshot, the first two statements got 75 seconds (60 is Max) and 77 minutes. That’s why NULL has returned. Within the last Date Function statement, we used HOUR, MINUTE, and SECOND function inside this MAKETIME function. This might helps you to understand how we can use other date functions inside this function.

Filed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions

Copyright © 2021ยท All Rights Reserved by Suresh.
About | Contact | Privacy Policy