跳到主要内容
跳到主要内容

LOCALTIME,LOCALTIMESTAMP

localtime,localtimestamp

description

Syntax

DATETIME localtime() DATETIME localtimestamp()

获得当前的时间,以Datetime类型返回

Example

mysql> select localtime();
+---------------------+
| localtime() |
+---------------------+
| 2022-09-22 17:30:23 |
+---------------------+

mysql> select localtimestamp();
+---------------------+
| localtimestamp() |
+---------------------+
| 2022-09-22 17:30:29 |
+---------------------+

keywords

localtime,localtimestamp