Categories:

Context Functions (General)

LOCALTIME¶

Returns the current time for the system.

ANSI-compliant alias for CURRENT_TIME.

Syntax¶

LOCALTIME()

LOCALTIME
Copy

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();
Copy
+-------------+-------------------------------+
| LOCALTIME() | LOCALTIMESTAMP()              |
|-------------+-------------------------------|
| 15:32:45    | 2024-04-17 15:32:45.775 -0700 |
+-------------+-------------------------------+