根据参数类型将参数转换为日期时间值。
转化
toDateTime(<parameters>)
参数 | 类型 |
---|---|
ISO-8601格式的日期时间 | 字符串 |
时区id | 字符串 |
不带时区的日期时间 | dateTimeOnly |
纪元的整数值(以毫秒为单位) | 整数 |
时区ID必须是字符串常量。 它不能是字段引用或表达式。 有关数据类型的更多信息,请参阅 此页面.
toDateTime(<string>)
toDateTime(<stringified time zone id>, <dateTimeOnly>)
toDateTime(<integer>)
返回 dateTime.
toDateTime ("2016-08-18T23:17:59.123Z")
返回2016-08-18T23:17:59.123赫
toDateTime(toDateTimeOnly("UTC", "2016-08-18T23:17:59.123"))
返回2016-08-18T23:17:59.123赫
toDateTime(1560762190189)
返回2019-06-17T09:03:10.189赫