public static Date getLastDayFromCurrentMonth ( Date d ) { Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( d ) ; cal . set ( Calendar . DAY_OF_MONTH , cal . getActualMaximum ( Calendar . DATE ) ) ; cal . set ( Calendar . HOUR_OF_DAY , 23 ) ; cal . set ( Calendar . MINUTE , 59 ) ; cal . set ( Calendar . SECOND , 59 ) ; cal . set ( Calendar . MILLISECOND , 999 ) ; return cal . getTime ( ) ; }
Get last date from current month