if(month == 2) {
if(year%4 == 0) day = 29;
else day = 28;
}
elseif (month == 4 || month == 6 || month == 9 || month == 11) day = 30;
else day = 31;
The problem with your code at the minute is you're not actually checking whether the month is february.
Its also possible (as stated above) to trigger both your if statements which you wouldn't want to do. In my code only one of the 5 if, else if or else statements can ever be triggered.