Here you can find the source of getFirstDayOfMonth(String format)
public static String getFirstDayOfMonth(String format)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static String getFirstDayOfMonth(String format) { String strDate = null;/* w ww. j av a 2 s .c o m*/ try { Calendar c = new GregorianCalendar(); SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat( format); //???????? c.set(GregorianCalendar.DAY_OF_MONTH, 1); strDate = mSimpleDateFormat.format(c.getTime()); } catch (Exception e) { e.printStackTrace(); } return strDate; } }