date conversion: from day of the month to day of the year and vice versa