Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static long getTimesMonthMorning() { Calendar cal = Calendar.getInstance(); cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); return cal.getTimeInMillis(); } }