Get Number of Days in a Month Using Apex

Date dt = System.today();
Integer days = date.daysInMonth(dt.Year(), dt.Month());
System.debug('Number of days-' + days);