Returns the number of days in the month for the specified year and month (1=Jan).
Here are some examples:
Integer numberDays = date.daysInMonth(1960, 2); System.debug(numberDays);
Output: 29