根據參數的類型,將參數轉換為日期時間值。
轉換
toDateTime(<parameters>)
參數 | 類型 |
---|---|
ISO-8601格式的日期時間 | 字串 |
時區ID | 字串 |
無時區的日期時間 | dateTimeOnly |
一個紀元的整數值(以毫秒為單位) | 整數 |
時區ID必須是字串常數。 它不能是欄位引用或表達式。 有關資料類型的詳細資訊,請參閱此頁。
toDateTime(<string>)
toDateTime(<dateTimeOnly>,<stringified time zone id>)
toDateTime(<integer>)
傳回dateTime。
toDateTime ("2016-08-18T23:17:59.123Z")
傳回2016-08-18T23:17:59.123Z
toDateTime(toDateTimeOnly("2016-08-18T23:17:59.123"),"UTC")
傳回2016-08-18T23:17:59.123Z
toDateTime(1560762190189)
傳回2019-06-17T09:03:10.189Z