MySQL: MAKETIME Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL MAKETIME Function

In this guide, we will explain how to use the MySQL MAKETIME function with syntax and examples.

Description

The MySQL MAKETIME function returns the time for a certain hour, minute, second combination.

Syntax

The syntax for the MAKETIME function is:

MAKETIME( hour, minute, second )

Parameters or Arguments

hour

The hour value used to create the time.

minute

The minute value used to create the time.

second

The second value used to create the time.

Note

  • Time values range from ‘-838:59:59’ to ‘838:59:59’.

Applies To

The MAKETIME function can be used in the following versions :

  • 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 MAKETIME function examples and explore how to use the MAKETIME function.

For example:

mysql> SELECT MAKETIME(11,28,1);
        -> '11:28:01'

mysql> SELECT MAKETIME(14,31,0);
        -> '14:31:00'

mysql> SELECT MAKETIME(23,59,59);
        -> '23:59:59'

mysql> SELECT MAKETIME(838,59,59);
        -> '838:59:59'

mysql> SELECT MAKETIME(-838,59,59);
        -> '-838:59:59'

Next Topic : Click Here

This Post Has One Comment

Leave a Reply