Here you can find the source of getCurrentMonth(boolean bool, String currentDate)
public static String getCurrentMonth(boolean bool, String currentDate)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getCurrentMonth(boolean bool, String currentDate) { Calendar date1 = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date date = null;/*ww w . ja v a 2 s.c o m*/ try { date = sdf.parse(currentDate); } catch (ParseException e) { e.printStackTrace(); } date1.setTime(date); date1.set(Calendar.DATE, 1); if (bool) { } else { date1.add(Calendar.MONTH, 1); } return sdf.format(date1.getTime()); } }