I have tried different things to modify the following code and have been unsuccessful. The following code is to get the julian date number. I need to alter it to make it return the day number (between 1 - 366) within a given year. Can anybody help?
(fyi - this code was previously the julianDayNumber which I acquired from a previous assignment)
int a, yr, mnth; int dayOfYear; // calculate Julian day for a date a = (14 - month) / 12; yr = year + 4800 - a; mnth = month + 12 * a - 3; dayOfYear = day + (153 * mnth + 2) / 5 + 365 * yr + yr/4 - yr / 100 + yr / 400 - 32045; return dayOfYear;