Java examples for java.util:Month
set Start Of Month
//package com.java2s; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { Calendar calendar = Calendar.getInstance(); System.out.println(setStartOfMonth(calendar)); }/*from w w w.java2 s. com*/ public static Calendar setStartOfMonth(Calendar calendar) { calendar.set(Calendar.DAY_OF_MONTH, 1); calendar = setStartOfDate(calendar); return calendar; } public static Calendar setStartOfDate(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar; } }