Date.ToText
Επιστρέφει μια αναπαράσταση κειμένου της τιμής ημερομηνίας.
Syntax
Date.ToText(
date as date,
optional options as any,
optional culture as text
) as text
Remarks
Returns a textual representation of date. An optional record parameter, options, may be provided to specify additional properties. culture is only used for legacy workflows. The record can contain the following fields:
Format: Atextvalue indicating the format to use. For more details, go to https://go.microsoft.com/fwlink/?linkid=2180104 and https://go.microsoft.com/fwlink/?linkid=2180105. Omitting this field or providingnullwill result in formatting the date using the default defined byCulture.Culture: WhenFormatis not null,Culturecontrols some format specifiers. For example, in"en-US""MMM"is"Jan", "Feb", "Mar", ..., while in"ru-RU""MMM"is"янв", "фев", "мар", .... WhenFormatisnull,Culturecontrols the default format to use. WhenCultureisnullor omitted,Culture.Currentis used.
To support legacy workflows, options and culture may also be text values. This has the same behavior as if 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
Βρείτε το έτος στο ημερολόγιο Χίζρι που αντιστοιχεί στην 1η Ιανουαρίου 2000 στο Γρηγοριανό ημερολόγιο.
Date.ToText(#date(2000, 1, 1), [Format="yyyy", Culture="ar-SA"])
Result:
"1420"
Category
Date