HotDocs Author WorkflowCreate a template Upload a template Manage components

Date Variable Overview

A Date variable is a type of variable that represents an unknown date value. For example, if you want to ask a template user for a date of birth, you would create a Date variable in your template to capture that specific item of data.


In HotDocs, a Date variable is a component that represents an unknown date in your template (i.e. a date value, such as a combination of a calendar day, month, or year—11 Feb 2001)

). You can create Date variables using the HotDocs Field Editor or Component Studio and Date variables are typically:

  • Referenced in the template by adding a placeholder field, indicating where HotDocs must place the variable's date value in the assembled document
  • Added to a dialog, so the variable's question appears in the interview; template users can then type the value allocated to the variable
  • Used in a computation to supply an item of data used by the computation's script

Like other components, Date variables have properties that you can set to define how they perform in an interview and how HotDocs processes the Date variable in an assembled document. In fact, Date variables have a number of unique properties, which you can review below.

Common Tasks

Among others, Date variables enable you to accomplish the following common tasks:


When you create a template from an existing document, the existing document usually contains placeholders for dates that are unknown. To enable template users to provide the unknown date, you:

  • Create new Date variables to represent the individual unknown date values (either in the Field Editor or Component Studio)
  • Replace all placeholders in the template with placeholder fields that reference your variables

When creating a Date variable, you can set properties that define how to gather an unknown date value from a template user, how HotDocs stores that date value as an answer, and how to format that answer when assembling a document. For example, you start by setting the name property for the Date variable, which is used to identify the Date variable throughout Author and in the answer file. You can set the Prompt property to provide instructive text (as opposed to the Date variable name) to help a template user answer a question during the interview. You can set the Default format property to define the pattern that HotDocs uses to format the template user's answer in the assembled document (such as whether or not to use a month abbreviation). Lastly, you can then group related date (and other) variables into dialogs to improve the usability and flow of an interview.

Once you have created the Date variable and set all of the properties you need, you can use the test feature to ensure the variable will behave as you desire when the document is assembled.

Date Variable Properties

Like all variables, Date variables have properties you can use to edit how the Date variable appears in an interview, how the Date variable is processed during assembly, etc. However, Date variables do not have any properties that are unique (all of the properties you can use for Date variables are the same as other variable properties).

When to Use Date Variables

To better understand when to use a Date variable (as opposed to the other types of variables), consider the following:

  • A Date variable is a type of variable that represents an unknown date value (e.g. 11 June 2001)
  • A date value is any value that you can express using any combination of the day, month, year (including the day of the week) in any sequence of your choice. For example, you would use a Date variable to gather the date 6/11/2001.
  • Date variables cannot be used to gather time of the day. If you need both the time of day and the date, you would create a Text variable (with the appropriate input mask) for the time and a Date variable.

Date Variables and Formats

When working with Date variables, there are times when you may want to control how a template user's answer to an interview question is displayed in an assembled document. For example, you may want dates selected from a date picker and recorded in the interview as 6/11/2001 to appear in the assembled document spelled out or arranged differently (e.g. Monday 11 June 2001 or Eleventh day of June, 2001). HotDocs enables you to make such modifications to answers based on date variables using date formats. To assist you in using date formats, HotDocs provides a set of commonly used date formats (such as formats that enable you to spell out the date completely, abbreviate months, set capitalization, and more) when you install Author.

You can either format a single instance of the placeholder field that references the variable, or you can format every placeholder field that references that variable throughout the template. You can also create your own custom format, should you need a format not included in the commonly used formats.

For more information on formats, you can read the Formats Overview and the Formatting an Answer document for more information.

Date Literals

When you want to refer to an unknown date value you a Date variable. When you want to refer to a known date value in scripting, you use a date literal.

Common Reference Topics

Among others, the following reference topics may relate to this conceptual area: