Here you can find the source of getStartCurrentMonth()
public static long getStartCurrentMonth()
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static long getStartCurrentMonth() { return getStartCurrentMonthCal().getTimeInMillis(); }/*from w ww . j av a 2 s. c om*/ public static Calendar getStartCurrentMonthCal() { Calendar calendar = getCalendar(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar; } private static Calendar getCalendar() { Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(new Date()); return calendar; } }