Here you can find the source of getMonthEndDate(Long day)
public static Long getMonthEndDate(Long day)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static Long getMonthEndDate(Long day) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(day);/*from w w w .j ava 2 s . c o m*/ int end = cal.getActualMaximum(Calendar.DATE); cal.set(Calendar.DATE, end); return cal.getTimeInMillis(); } }