Here you can find the source of getPreMonthText(String pattern)
public static String getPreMonthText(String pattern)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getPreMonthText(String pattern) { Calendar c = Calendar.getInstance(); c.add(Calendar.MONTH, -1); SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(c.getTime()); }/*from w ww . ja va 2s .c om*/ }