to_timestamp_ltz

to_timestamp_ltz

to_timestamp_ltz 介绍

to_timestamp_ltz(timestamp_str[, fmt]) - 使用fmt表达式解析timestamp_str表达式到带有本地时区的时间戳。如果输入无效,则返回null。如果省略了fmt,默认情况下,它遵循将字符串转换为带有本地时区的时间戳的规则。

参数:

  • timestamp_str - 要解析为带有本地时区的时间戳的字符串。
  • fmt - 时间戳格式模式。请参阅日期时间模式以获取有效的日期和时间格式模式。

Examples:

> SELECT to_timestamp_ltz('2016-12-31 00:12:00');
 2016-12-31 00:12:00
> SELECT to_timestamp_ltz('2016-12-31', 'yyyy-MM-dd');
 2016-12-31 00:00:00

Since: 3.4.0