适用于:
Databricks SQL
Databricks Runtime
针对 UTC 的 expr 时间戳返回 timeZone 的时间戳。
语法
from_utc_timestamp(expr, timeZone)
争论
expr:带有 UTC 时间戳的TIMESTAMP表达式。timeZone:一个STRING表达式,表示有效时区。
返回
一个 TIMESTAMP。
示例
> SELECT from_utc_timestamp('2016-08-31', 'Asia/Seoul');
2016-08-31 09:00:00
> SELECT from_utc_timestamp('2017-07-14 02:40:00.0', 'GMT+1');
'2017-07-14 03:40:00.0'