MySQL: CURTIME Function

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

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

Description

The MySQL CURTIME function returns the current time.

Syntax

The syntax for the CURTIME function is:

CURTIME( )

Parameters or Arguments

There are no parameters or arguments for the CURTIME function.

Note

  • The CURTIME function will return the current date as a ‘HH:MM:SS’ format, if used in a string context.
  • The CURTIME 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 CURTIME 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 CURTIME 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 CURTIME function examples and explore how to use the CURTIME function.

For example:

mysql> SELECT CURTIME();
Result: '10:37:02'

mysql> SELECT CURTIME() + 0;
Result: 103702.000000

mysql> SELECT CURTIME() + 1;
Result: 103703.000000

Next Topic : Click Here

This Post Has One Comment

Leave a Reply