/**
? * 格式化日期1
? * */
??? public static String formatTime( Calendar cal, String format ){
??????? SimpleDateFormat localTimeFormatter
??????????? = new SimpleDateFormat(format);
??????? return localTimeFormatter.format(cal.getTime());
??? }
??? /**
? * 格式化日期2
? * */
??? public static Calendar formatDate( String time, String format ){
??????? try{
??????????? Date d = new Date();
??????????? SimpleDateFormat timeFormatter1
??????????????? = new SimpleDateFormat(format);
??????????? d = timeFormatter1.parse(time);
??????????? Calendar cal = Calendar.getInstance();
??????????? cal.setTime(d);
??????????? return cal;
??????? }catch ( Exception ex ){
??????????? log.error("error: ", ex);
??????????? return Calendar.getInstance();
??????? }
??? }