public Date parseDate(String str){
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = format1.parse(str);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return date;
}
public Map<String,Integer> returnDate(String str){
Date d_date = null;
Map<String,Integer> map = new HashMap<String,Integer>();
d_date = parseDate(str);
Integer year = new Integer(String.format("%tY", d_date));
Integer month = new Integer(String.format("%tm", d_date));
Integer day = new Integer(String.format("%td", d_date));
Integer hourse = new Integer(String.format("%tH", d_date));
Integer minute = new Integer(String.format("%tM", d_date));
Integer second = new Integer(String.format("%tS", d_date));
map.put("year",year);
map.put("month",month);
map.put("day",day);
map.put("hourse",hourse);
map.put("minute",minute);
map.put("second",second);
return map;
}