Here you can find the source of getEndCurrentMonth()
public static long getEndCurrentMonth()
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static long getEndCurrentMonth() { return getEndCurrentMonthCal().getTimeInMillis(); }// ww w . j a va 2 s .c o m public static Calendar getEndCurrentMonthCal() { Calendar calendar = getCalendar(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); calendar.set(Calendar.MILLISECOND, 999); return calendar; } private static Calendar getCalendar() { Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(new Date()); return calendar; } }