Here you can find the source of getCurrMonthLastDay()
public static String getCurrMonthLastDay()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static Calendar ca = Calendar.getInstance(); public static String getCurrMonthLastDay() { ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH)); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String last = format.format(ca.getTime()); return last; }/*from w w w . ja v a 2s . c o m*/ }