Mysql Current_time Function

MySQL: CURRENT_TIME Function

This tutorial explains how to use the MySQL CURRENT_TIME function with syntax and examples.

Description

The MySQL CURRENT_TIME function returns the current time.

Syntax

The syntax for the CURRENT_TIME function in MySQL is:

CURRENT_TIME( )

Parameters or Arguments

There are no parameters or arguments for the CURRENT_TIME function.

Note

  • The CURRENT_TIME function will return the current date as a 'HH:MM:SS' format, if used in a string context.
  • The CURRENT_TIME function will return the current date as a HHMMSS format, if used in a numeric context in versions of MySQL prior to MySQL 4.1.13.
  • The CURRENT_TIME function will return the current date as a HHMMSS.uuuuuu format, if used in a numeric context in versions of MySQL 4.1.13 and newer.
  • The CURRENT_TIME function is a synonym for the CURTIME function.

Applies To

The CURRENT_TIME function can be used in the following versions of MySQL:

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let's look at some MySQL CURRENT_TIME function examples and explore how to use the CURRENT_TIME function in MySQL.

For example:

mysql> SELECT CURRENT_TIME();
Output: '10:37:02'

mysql> SELECT CURRENT_TIME() + 0;
Output: 103702.000000

mysql> SELECT CURRENT_TIME() + 1;
Output: 103703.000000