根據參數的類型將參數轉換為日期時間值。
轉換
toDateTime(<parameters>)
參數 | 類型 |
---|---|
ISO-8601格式的日期時間 | 字串 |
時區ID | 字串 |
無時區的日期時間 | 日期僅時間 |
時元的整數值(毫秒) | 整數 |
時區ID必須是字串常數。 它不能是欄位引用或表達式。 有關資料類型的詳細資訊,請參閱 此頁。
toDateTime(<string>)
toDateTime(<stringified time zone id>, <dateTimeOnly>)
toDateTime(<integer>)
返回 日期時間。
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