Files
doris/docs/documentation/cn/sql-reference/sql-functions/date-time-functions/unix_timestamp.md
Mingyu Chen 176e185e18 Add broker doc (#1662)
This broker document introduces the properties for different broker types.
2019-08-20 17:18:54 +08:00

725 B

unix_timestamp

description

Syntax

INT UNIX_TIMESTAMP(), UNIX_TIMESTAMP(DATETIME date)

将Date或者Datetime类型转化为unix时间戳

如果没有参数,则是将当前的时间转化为时间戳

参数需要是Date或者Datetime类型

example

mysql> select unix_timestamp();
+------------------+
| unix_timestamp() |
+------------------+
|       1558589570 |
+------------------+

mysql> select unix_timestamp('2007-11-30 10:30:19');
+---------------------------------------+
| unix_timestamp('2007-11-30 10:30:19') |
+---------------------------------------+
|                            1196389819 |
+---------------------------------------+

##keyword

UNIX_TIMESTAMP,UNIX,TIMESTAMP