DATETOTEXT

Converts any date value into a specific text format.

Syntax

DATETOTEXT(date-expression, {format-text})

Arguments

date-expression Date or value to be formatted.
format-text Format for the date.  Use the following conventions.  If no formatting is given, the default is %b %d, %Y.

%a - abbreviated weekday name, e.g., "Mon"
%A - full weekday name, e.g., "Monday"
%b - abbreviated month name, e.g., "Feb"
%B - full month name, e.g., "February"
%c - locale-specific date and time.
%d - day of the month as a decimal integer (01-31)
%H - the hour as a decimal integer (00-23)
%I - the hour as a decimal integer (01-12)
%j - day of the year as a decimal number (001-366)
%m - month, as a decimal number (01-12)
%M - minute, as a decimal number (00-59)
%p - locale-specific AM/PM designation for 12-hour clock
%S - second, as a decimal number (00-61)
%U - week number of the year (00-53)
%w - weekday as a decimal number (0-6, Sunday = 0)
%W - week number of the year. Week number 1 has the first Monday. Days before that are week 0.
%x - locale-specific date
%X - locale-specific time
%y - year as a decimal number (00-99).
%Y - year with century as decimal number, e.g., 1984.
%Z - time zone name or abbreviation, or none if not known.
%% - a blank space.

Example

DATETOTEXT(0,"%B - %Y") returns "December - 1969".