Java Month Name Get getPreMonthText(String pattern)

Here you can find the source of getPreMonthText(String pattern)

Description

get Pre Month Text

License

Apache License

Declaration

public static String getPreMonthText(String pattern) 

Method Source Code


//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*/
}

Related

  1. getMonthSelect(String selectName, String value, boolean hasBlank)
  2. getMonthStr(int month)
  3. getMonthStr(int month)
  4. getMonthStr(String str)
  5. getMonthString(int month)
  6. month(String monthName)
  7. monthCalValue(String monthName)
  8. monthName(int month)
  9. monthName(int n)