更新时间:2019-03-05 15:48
current_date()
命令说明:返回当前日期
返回值类型:DATE
示例:
select current_date()
+--------------------+
| _col0 |
+--------------------+
| 2018-12-27 |
current_time()
命令说明:返回当前时间
返回值类型:TIME
示例:
select current_time()
+--------------------+
| _col0 |
+--------------------+
| 13:52:56 |
current_timestamp()
命令说明:返回当前时间戳
返回值类型:TIMESTAMP
示例:
select current_timestamp()
+------------------------+
| _col0 |
+------------------------+
| 2018-12-27 13:54:42 |
current_timezone()
命令说明:返回当前时区
返回值类型:VARCHAR
示例:
select current_timezone()
+--------------------+
| _col0 |
+--------------------+
| Asia/Shanghai |
from_unixtime()
命令说明:返回unixtime时间戳
返回值类型:TIMESTAMP
示例:
select from_unixtime(1522292553)
+------------------------+
| _col0 |
+------------------------+
| 2018-03-29 11:02:33 |
localtime()
命令说明:返回本地时间
返回值类型:TIME
示例:
select localtime()
+--------------------+
| _col0 |
+--------------------+
| 13:58:17 |
localtimestamp()
命令说明:返回当前本地时间戳
返回值类型:TIMESTAMP
示例:
select localtimestamp()
+----------------------+
| _col0 |
+----------------------+
| 2018-12-27 13:59:33 |
now()
命令说明:返回当前时间戳
返回值类型:TIMESTAMP
示例:
select now()
+------------------------+
| _col0 |
+------------------------+
| 2018-12-27 14:01:00 |
to_unixtime(now())
命令说明:转换为unix时间戳
返回值类型:DOUBLE
示例:
select to_unixtime(now())
+--------------------+
| _col0 |
+--------------------+
| 1545890562 |
UTC_DATE(now())
命令说明:返回utc日期
返回值类型:VARCHAR
示例:
select UTC_DATE()
+--------------------+
| _col0 |
+--------------------+
| 2018-12-27 |
UTC_TIME()
命令说明:返回utc时间
返回值类型:VARCHAR
示例:
select UTC_TIME()
+--------------------+
| _col0 |
+--------------------+
| 06:12:71 |
utc_timestamp()
命令说明:返回utc时间戳
返回值类型:VARCHAR
示例:
select utc_timestamp()
+---------------------+
| _col0 |
+---------------------+
| 2018-12-27 06:12:18 |
在文档使用中是否遇到以下问题
更多建议
匿名提交