To get the julian date, you will first have to determine if the current year is a leap year. Do this by taking the year mod 4. If it is 0, (with the possible exception of the year being 00), it is a leap year.

Make an array (constant) containing the julian date of the begin of each month (i.e. month 1 = 1, month 2 = 32, month 3 = 50, month 4 = 81, etc.). If you call this array montharray, you could calculate the day of the year using this formula

day := montharray[monthnum]+dayof

if leapyear and monthnum>2 then day := day + 1;