FORMATDATE function

FORMATDATE(Date, DateFormat?) FORMATDATE(Date; DateFormat?)

Date

Number or { Number }

The date to format.

DateFormat

DateFormat or { DateFormat } (optional)

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

Text or { Text }

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:

FORMATDATE(NOW()) & ", " & FORMATTIME(NOW())FORMATDATE(NOW()) & ", " & FORMATTIME(NOW())

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

Examples

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. DateFormat.NumericDateFormat,Numeric is assumed if no second parameter is given.

FORMATDATE(DATE(1981, 11, 14), DateFormat.Numeric)FORMATDATE(DATE(1981; 11; 14); DateFormat,Numeric)

Returns "11/14/81" if the language of the app is set to US English.

FORMATDATE(DATE(1981, 11, 14), DateFormat.Numeric)FORMATDATE(DATE(1981; 11; 14); DateFormat,Numeric)

Returns "14.11.81" if the language of the app is set to German.

FORMATDATE(NOW()) & ", " & FORMATTIME(NOW())FORMATDATE(NOW()) & ", " & FORMATTIME(NOW())

Returns today's date, followed by a comma, a space and the current time.

FORMATDATE(DATE(1981, 11, 14), DateFormat.Month)FORMATDATE(DATE(1981; 11; 14); DateFormat,Month)

Returns "Nov 1981" if the language of the app is set to US English.

FORMATDATE(DATE(1981, 11, 14), DateFormat.Abbreviated)FORMATDATE(DATE(1981; 11; 14); DateFormat,Abbreviated)

Returns "Nov 14, 1981" if the language of the app is set to US English.

FORMATDATE(DATE(1981, 11, 14), DateFormat.Full)FORMATDATE(DATE(1981; 11; 14); DateFormat,Full)

Returns "November 14, 1981" if the language of the app is set to US English.

FORMATDATE(DATE(1981, 11, 14), DateFormat.FullDayInWeek)FORMATDATE(DATE(1981; 11; 14); DateFormat,FullDayInWeek)

Returns "Saturday, November 14, 1981" if the language of the app is set to US English.