Sep 17

Use the Calendar class to set the day of the month to the last day of the month.

Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, 
   cal.getActualMaximum(Calendar.DAY_OF_MONTH));
Date lastDayOfTheMonth = cal.getTime(); 

written by objects \\ tags: ,


Leave a Reply

You must be logged in to post a comment.