根据参数的类型,将参数转换为日期时间值。
转化
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.123Z
toDateTime(toDateTimeOnly("UTC", "2016-08-18T23:17:59.123"))
返回2016-08-18T23:17:59.123Z
toDateTime(1560762190189)
返回2019-06-17T09:03:10.189Z