DATE OF( NUM, NUM, NUM )
Placeholder | Tooltip | Replace With |
NUM | day: Number | A number value representing the day of the month (from 1 to 31) |
NUM | month: Number | A number value representing the month (from 1 to 12) |
NUM | year: Number | A number value representing the year (should be four digits) |
Returns a Date value
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:
IF Hire Date <= DATE OF ( 15, 8, YEAR OF( TODAY ) )
Employee Name + " qualifies for the annual bonus."
END IF
HotDocs uses an IF instruction to compare Hire Date 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 DATE OF expression:
DATE OF ( 1, MONTH OF( Hire Date + 1 MONTHS ), YEAR OF( Hire Date + 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).