toDateTime

上次更新: 2023-08-17
  • 主題:
  • Journeys
    檢視有關此主題的更多資訊
  • 建立對象:
  • Experienced
    Developer

根據引數的型別,將其轉換為日期時間值。

類別

轉換

函式語法

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盎司

此頁面上的