HotDocs Models: dateOf( num, num, num )

Placeholder Replace With
num A number value representing the day of the month (from 1 to 31)
num A number value representing the month (from 1 to 12)
num A number value representing the year (should be four digits)

This expression finds a date value based on day, month, and year values.

You can use this expression to compare a date the user gives with another date, such as a cut-off date for when an employee had to be hired to qualify for a yearly bonus. The following computation script demonstrates this:

if HireDate <= dateOf( 15, 8, yearOf( today ) )

EmployeeName + " qualifies for the annual bonus."

endIf

HotDocs uses an if instruction to compare HireDate with August 15 of the current year. If the comparison returns a true value, the employee qualifies for the bonus.

Suppose, in this next example, a new employee qualifies for a benefits package on the first day of the second month of employment—regardless of what day the employee was hired during the first month of employment. You can calculate that date with the dateOf expression:

dateOf( 1, monthOf( HireDate + 1 months), yearOf( HireDate + 1 months))

The first parameter in the expression, 1, tells HotDocs to specify the first day of the month. The second parameter identifies the month of the hire date and adds one month. The third parameter determines the year of the hire date (plus one month).