Hmmm, so if you calculate the day of 10th of February (month == 2), you add one day if the year is a leap year.
So 10th of Feb is normaly day 41, but in a leap year it is day 42?
And 1st of March? Normaly day 60. And in a leap year? With your code it is also day 60.
If the year is a leap year, you must add 1 day if the month is greater then 2!
And your information about leap year is wrong. Not every year that can be devided by 4 is a leap year.
This is true in Julian system, but not in Gregorian system.
But you can built in a check for calendar system.
The important date is Friday, 15th October 1582.
All dates before should be calculated according Julian system and all dates thereafter in Gregorian system.