根據引數的型別,將其轉換為日期時間值。
轉換
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盎司