共用方式為


totimespan()

適用於:✅Microsoft網狀架構

將輸入轉換成 時間範圍 純量值。

已被取代的別名: totime()

注意

可能的話,建議您改用 時間範圍常值

語法

totimespan( value)

深入瞭解 語法慣例

參數

姓名 類型​​ 必要 Description
value string ✔️ 要轉換成 時間範圍的值。

傳回

如果轉換成功,結果會是 時間範圍 值。 否則,結果為 null。

範例

下列範例會檢查輸入是否符合定義的時間範圍。

let value=5;
print minsStr=totimespan("0.00:03:00"), days=totimespan(4d), hour=totimespan(value * 1h), mins=totimespan(value * 2m), seconds=totimespan(5 * 4s), timespanMin=timespan(25min)

輸出

minsStr 小時 分鐘 timespanMin
00:03:00 4.00:00:00 05:00:00 00:10:00 00:00:20 00:25:00