How to find the number of days for a month using Apex in Salesforce? September 26, 2014June 9, 2022InfallibleTechie Admin Sample Code: Integer numberDays = Date.daysInMonth(2014, 2); system.debug(‘No of days in this month is ‘ + numberDays); Output: Cheers!!!