Insert a Date in Reverse Order

HotDocs Version:HD6, HD2005, HD2006, HD2007, HD2008, HD2009
Word Processor:Microsoft Word, WordPerfect
Added to Knowledge Base:September 2004

Sometimes you need to insert a date in reverse order. For example, you want May 10, 2000 to be inserted as 10/5/00. You may try to use the format 03/06/90. However, with a default date order of month-day-year, HotDocs still sees 03 as representing the month, 06 as representing the day, and 90 as representing the year.

One way to solve this problem is to create a Computation variable that contains DAY OF, MONTH OF, and YEAR OF expressions to format the date as desired.

Note: HotDocs can recognize dates entered in two orders: month-day-year (the default order in the United States) and day-month-year (the default outside the U.S.). You can select the default date entry order at HotDocs Options. See the HotDocs Help for details.

The following computations use DAY OF, MONTH OF, and YEAR OF expressions to format a date in different formats.

Example:
//Example 1: Format a date as d/m/yy.
FORMAT( DAY OF( Date Var ), "9" ) + "/" +
FORMAT( MONTH OF( Date Var ), "9" ) + "/" +
FORMAT( REMAINDER( YEAR OF( Date Var ), 100 ),"09" )

//Example 2: Format a date as dd/mm/yyyy.
FORMAT( DAY OF( Date Var ), "09" ) + "/" +
FORMAT( MONTH OF( Date Var ), "09" ) + "/" +
FORMAT( YEAR OF( Date Var ), "9999" )

 Date Var

Any Date variable.