跳到主要内容

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) 转换为文本值。结果输出可能因当前区域性而异。

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