Calculate day of the year number.