Friday, December 21, 2018

How to get current Month last date in Apex?

This post explains how to get the current month last date in the apex.

Example:

Date dLastDate = Date.today().addMonths(1).toStartOfMonth().addDays(-1);
System.debug(' current month last date ===> '+dLastDate);

Result
Let us know if you have any queries
Happy Learning!!!

1 comment: