Java examples for java.util:Month
is Month First Day
import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main{ public static void main(String[] argv) throws Exception{ Date date = new Date(); System.out.println(isMonthFirstDay(date)); }/*from w ww. j ava 2 s . c o m*/ public static Boolean isMonthFirstDay(Date date) { return sf.format(date) .equals(CalendarUtil.getFirstDayOfMonth(date)); } public static String getFirstDayOfMonth(Date date) { SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-01"); return sf.format(date); } }