top of page

106. Day of the Year

Description

Determine the day of the year (from 1 - 365/6).

Code

DAYS FROM( DATE OF( 1, 1, YEAR OF( DateVar ) ), DateVar ) + 1

Explanation

HotDocs does not provide a DAY OF YEAR() model. This computation provides that functionality. For a given DateVar, the computation determines the day of the year from 1-365 (366 for leap year). For example: New Year's Day is day 1, Valentine's Day is day 45, etc.

The day of year is found by determining the DAYS FROM January 1 of the year in question to the given DateVar (you could also use TODAY). We then add one day (otherwise Jan. 1 would be day zero). The resulting day of year is returned as a number value.

bottom of page