跳至主要内容

Time.ToText

傳回時間值的文字表示法。

Syntax

Time.ToText(
time as time,
optional options as any,
optional culture as text
) as text

Remarks

傳回以文字表示的 time。可能會提供選用的 record 參數 (options) 來指定其他屬性。culture 僅用於舊版工作流程。record 可能包含下列欄位:

若要支援舊版工作流程,optionsculture 也可以是文字值。這與 options = [Format = options, Culture = culture] 具有相同的行爲。

Examples

Example #1

#time(01, 30, 25) 轉換爲 text 值。結果輸出可能因目前文化特性而有所不同。

Time.ToText(#time(11, 56, 2))

Result:

"11:56 AM"

Example #2

使用自訂格式和德文文化特性進行轉換。

Time.ToText(#time(11, 56, 2), [Format="hh:mm", Culture="de-DE"])

Result:

"11:56"

Example #3

使用標準時間格式進行轉換。

Time.ToText(#time(11, 56, 2), [Format="T", Culture="de-DE"])

Result:

"11:56:02"

Category

Time