DateToText (date, [format])

Result Type: Text

Definition: Converts the supplied date to text in the requested format. Format is a name or value from the table below—the sample output shown is for the 31st January 2016 with the date format in the system settings being "dd/mm/yy".

NameValueSample Output
DateFormLong1Sunday, 31 January 2016
DateFormAbbrev231 January 2016
DateFormLongDateAndTime-1Sunday, 31 January 2016 12:00:00 am
DateFormAbbrevDateAndTime-231 January 2016 12:00:00 am
DateFormShortDateAndTime-331/01/16 12:00:00 am
DateFormTimeOnly-412:00:00 am
DateFormTimeOnlyNoSecs-512:00 am
The following formats are not affected by your system settings
DateFormDDMMYYHHMMSSTT-631/1/2016 12:00:00 A

Examples:  DateToText('21/2/68')

returns 21/2/68 (but the format may differ depending on the calculation box format).

DateToText('21/2/68', 0) or DateToText('21/2/68', DateFormShort)

returns 21/2/68.

DateToText('21/2/68', 1) or DateToText('21/2/68', DateFormLong)

gives Wednesday, 21 February, 1968.

DateToText('21/2/68', 2) or DateToText('21/2/68', DateFormAbbrev)

returns Wed, Feb 21, 1968

See Also:

CurrentPeriod: Get the current period number

Date: Convert d,m,y to a date

DateToPeriod: Convert a date to a period

Day: Get the Day of month of a date

DayOfWeek: Get The weekday of a date

Month: Get the month of a date

PeriodName: Get the Name of a period

PeriodOffset: Difference between two periods

PeriodToDate: Get the end date of a period

TextToDate: Parse a string to a date

Time: The current Datetime

Today: Today's date

WeekOfYear: Convert a date to a week number

Year: Year of a date