FORMATDATE function
Date
The date to format.
DateFormat
The date format to use when formatting the date. Use DateFormat.MonthDateFormat,Month for a text string only consisting of the month and year of the date ("Nov 1981"). Use DateFormat.NumericDateFormat,Numeric for a text string where the day, month and two-digit year appear as numbers ("11/14/81"). Use DateFormat.AbbreviatedDateFormat,Abbreviated for a text string where the day and year appear as numbers and the month as an abbreviated version of its name ("Nov 14, 1981"). If the month should be written out in full, use DateFormat.FullDateFormat,Full ("November 14, 1981"). Use DateFormat.FullDayInWeekDateFormat,FullDayInWeek if the day of the week should be included ("Saturday, November 14, 1981"). All examples use US English date formatting. If omitted, DateFormat.NumericDateFormat,Numeric is assumed.
Returns
A date formatted as text.
Returns a date as text. FORMATDATE(DATE(1981, 11, 14))FORMATDATE(DATE(1981; 11; 14)), returns "11/14/81" if the language of the app is set to US English. FORMATDATE takes the language of the app into account when converting dates.
Use FORMATTIME together with FORMATDATE to format both a date and a time. This formula returns the current date and time, joined together with a comma and a space:
This function is specific to Calcapp.
Date format
The second parameter may be set to the desired date format. These are the allowed values:
Date format | US English example |
---|---|
DateFormat.Month
|
Nov 1981 |
DateFormat.Numeric (default)
|
14/11/81 |
DateFormat.Abbreviated
|
Nov 14, 1981 |
DateFormat.Full
|
November 14, 1981 |
DateFormat.FullDayInWeek
|
Saturday, November 14, 1981 |
Related functions and properties
- Use PARSEDATE to turn text strings produced by this function back into dates.
- Use FORMATTIME to create text strings that can be interpreted by the PARSETIME function.
- Use PARSETIME to turn text strings produced by FORMATTIME back into times.
- Use the FormattedValue property of a date and time field to return its value as a text string, formatted according to the date and time format set for the field.
Examples
Returns "11/14/81" if the language of the app is set to US English. DateFormat.NumericDateFormat,Numeric is assumed if no second parameter is given.
Returns "11/14/81" if the language of the app is set to US English.
Returns "14.11.81" if the language of the app is set to German.
Returns today's date, followed by a comma, a space and the current time.
Returns "Nov 1981" if the language of the app is set to US English.
Returns "Nov 14, 1981" if the language of the app is set to US English.
Returns "November 14, 1981" if the language of the app is set to US English.