Sample Code:
Date dt = System.today(); Integer numberOfDays = Date.daysInMonth(dt.year(), dt.month()); Date lastDayOfMonth = Date.newInstance(dt.year(), dt.month(), numberOfDays); System.debug('lastDayOfMonth-' + lastDayOfMonth);
Sample Code:
Date dt = System.today(); Integer numberOfDays = Date.daysInMonth(dt.year(), dt.month()); Date lastDayOfMonth = Date.newInstance(dt.year(), dt.month(), numberOfDays); System.debug('lastDayOfMonth-' + lastDayOfMonth);