People please stop writing your own damned programs to deal with dates and times, or at least make them use standard mechanisms to determine if you’ve got a valid date of the month.
There are 29 days in the month of February in a leap year. Leap years happen every 4 years, but specifically don’t happen on years that are divisible by 100, but not by 400. So 1900 wasn’t a leap year. 2000 was, 2004 was and 2008 is.
If you need to check if a date is valid you need the day of the month, the month and the full year (i.e. 1900, 1999, 2000, 2004). Using a 2 digit year is tantamount to the Y2k problem.