The FormatDate()
function converts a date to text
Syntax
FormatDate(date, format)
FormatDate(date, language)
Returns
A new text string that is the text representation of a date.
Parameters
date
– a dateformat
– the format is used to specify how the date should be representedlanguage
– this parameter is used to specify the date representation of that language
If the format
or language
parameter contains an unknown value, then the default portal language is used to format the string.
See the microsoft documentation to learn more about format strings.
Examples
FormatDate(Now(), "MM-dd-yyyy")
/* returns "05-30-2017" */
FormatDate(Now(), "MMMM dddd dd yyyy")
/* returns "May Tuesday 30 2017" */
FormatDate(Now(), "ddd hh:mm tt")
/* returns "Tu 01:54 PM" */
FormatDate(Now(), "ddd HH:mm")
/* returns "Tu 13:54" */
FormatDate(Now(), en_US)
/* returns "5/30/2017 01:54:00 PM" */
FormatDate(Now(), nl_NL)
/* returns "30-5-2017 13:54:30" */