跳至主要内容

Date.ToText

傳回日期值的文字表示法。

Syntax

Date.ToText(
date as date,
optional options as any,
optional culture as text
) as text

Remarks

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

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

Examples

Example #1

#date(2010, 12, 31) 轉換爲 text 值。結果輸出可能因目前文化特性而有所不同。

Date.ToText(#date(2010, 12, 31))

Result:

"12/31/2010"

Example #2

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

Date.ToText(#date(2010, 12, 31), [Format="dd MMM yyyy", Culture="de-DE"])

Result:

"31 Dez 2010"

Example #3

在回曆中尋找對應於西曆 2000 年 1 月 1 日的年份。

Date.ToText(#date(2000, 1, 1), [Format="yyyy", Culture="ar-SA"])

Result:

"1420"

Category

Date