Java examples for java.util:Month
get First Day Of Month
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static void main(String[] argv) throws Exception { Date today = new Date(); System.out.println(getFirstDayOfMonth(today)); }/*from w ww . ja v a 2s .com*/ public static Date getFirstDayOfMonth(Date today) { Calendar calendar = Calendar.getInstance(); calendar.setTime(today); calendar.set(Calendar.DAY_OF_MONTH, 1); return calendar.getTime(); } }