hive :
hive> select unix_timestamp('2018-11-07T17:24:09.313-05:00')
> ;
OK
_c0
NULL
Time taken: 1.061 seconds, Fetched: 1 row(s)
hive> select unix_timestamp('2018-11-07T17:24:09.313')
> ;
OK
_c0
NULL
Time taken: 0.078 seconds, Fetched: 1 row(s)
hive> select unix_timestamp('2018-11-07 17:24:09.313') ;
OK
_c0
1541636649
可以发现带时区的时间,unix_timestamp无法转换。
hive> select unix_timestamp('2018-11-07 17:24:09.313+01:00');
OK
_c0
1541636649
hive> select unix_timestamp('2018-11-07 17:24:09.313-05:00');
OK
_c0
1541636649
可以发现其也无法识别时区的变化
hive> select to_unix_timestamp('2018-11-07T17:24:09.313+01:00')
> ;
OK
_c0
NULL
Time taken: 0.089 seconds, Fetched: 1 row(s)
hive> select to_unix_timestamp('