Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); public static String getMonthFirstDay() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); return dateFormat.format(calendar.getTime()); } }