根據參數的類型,將參數轉換為日期時間值。
轉換
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