In this guide, we will explain 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 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 :
- 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 CURRENT_TIME function examples and explore how to use the CURRENT_TIME function.
For example:
mysql> SELECT CURRENT_TIME(); Result: '10:37:02' mysql> SELECT CURRENT_TIME() + 0; Result: 103702.000000 mysql> SELECT CURRENT_TIME() + 1; Result: 103703.000000
Next Topic : Click Here
Pingback: MySQL: CURRENT_DATE Function | Adglob Infosystem Pvt Ltd