package com.chni.device.util;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Util {
/**
* 月份加一
* @param date
* @return
*/
public static String monthAddFrist(String date){
DateFormat df=new SimpleDateFormat("yyyy-MM");
try {
Calendar ct=Calendar.getInstance();
ct.setTime(df.parse(date));
ct.add(Calendar.MONTH, +1);
return df.format(ct.getTime());
} catch (ParseException e) {
e.printStackTrace();
}
return "";
}
public static void main(String[] args) {
System.out.println(Util.monthAddFrist("2014-2-12"));
}
}