FormatDate – XpressDox

Dates can be formatted according to patterns defined in the fillpoints.

 

Command structure:

«FormatDate(Date_of_Engagement,"yyyy-MM-dd")»
«FormatDate(Date_of_Signature,"MMM d yyyy")»
«FormatDate(Date_of_Dismissal,"d MMMM, yyyy")»

«FormatDate(Date_of_Signature,"MMMM o yyyy")»
«FormatDate(Date_of_Signature,"dddd MMMM o yyyy")»

 

These examples would result in something like, respectively:

2019-02-07
Feb 7 2019
7 February, 2019
February 7th 2019
Thursday February 7th 2019

The results are in English, not because the default language is English, but because the default is either the Word version’s language or else the language chosen by the user in the XpressDox Settings.

The date can be output in other languages because XpressDox supports the use of any ISO 639-1 language code in the FormatDate function. These codes are defined in the second column in ISO 639-1.

 

Superscript the ordinal suffix:

If you need the ‘th’ in the date February 29th 2008 to be superscripted in the final result, then another technique would be used:
«FormatDate(SignatureDate,"MMMM d")»«OrdinalSuffix(FormatDate(SignatureDate,"d"))» «FormatDate(SignatureDate,"yyyy")»
where the «OrdinalSuffix(...)» is superscripted in the template.

 

Output the date in upper case:

«ToUpper(Today(‘MMMM d yyyy’))»
«ToUpper(FormatDate(MeetingDate,‘MMMM d yyyy’))»

 

The Question command in v14:

The concept of Low Code authoring was introduced in v14, and with that the Question command. It is now possible to insert a Date Question into the template without the need for FormatDate. Inside the Question command, state that it is a date and select your desired format. Note that is a very simple way of inserting a date format and will not extend to the more complicated date formats, such as the superscripting of the ordinal suffix as described above. It is also possible to perform calculations on dates using the IncrementDate function, in which case it is better to use FormatDate.