Home > FAQ > Data Manipulation > Date Rounding in Expressions > Beginning of the current ... examples > Beginning of the current calendar year

Beginning of the current calendar year

This is the recommended expression for rounding dates to the beginning of the current calendar year:

BOY1_DT:= (-12) #MONTHROUND A_DT &

A_DT may be either a single date (e.g., 7/16/2015, DOH, #DODEC) or an array of dates (e.g., #DATE).

If you want to be consistent with the beginning of the current plan year methodology, then we recommend this expression: 

BOY1_DT:= #BEGMTH (1 #FSTBUSDAY A_DT) &
; find the first business day of the current calendar year, then round that first business day
; (i.e., 1/1, 1/2, or 1/3) to the beginning of month (i.e., 1/1)
We start with #FSTBUSDAY because it's the easiest way to work with plan years, but then we need to use #BEGMTH to guarantee that we are at the beginning of the month. 1 #FSTBUSDAY A_DT finds the first business day of the calendar year, which is either the first, second, or third day of the current calendar year, depending on whether the first day of the current calendar year is a weekday, Sunday or Saturday. If #FSTBUSDAY returns the second or third day of the calendar year, #BEGMTH converts it to the first day.