Categories:
Context Functions (General)

LOCALTIME

Returns the current time for the system.

ANSI-compliant alias for CURRENT_TIME.

Syntax

LOCALTIME()

LOCALTIME

Arguments

None.

Returns

Returns the current system time. The data type of the returned value is TIME.

Usage Notes

  • To comply with ANSI standards, this function can be called without parentheses.

Examples

Show the current local time and local timestamp:

SELECT LOCALTIME(), LOCALTIMESTAMP();

Output:

+-------------+-------------------------------+
| LOCALTIME() |    LOCALTIMESTAMP()           |
+-------------+-------------------------------+
|    17:18:02 | 2018-09-28 17:18:02.826 -0700 |
+-------------+-------------------------------+