public static void main(String[] args) throws IOException, ParseException {
String str = "2011-10-20 11:10:10";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date date = format.parse(str);
System.out.println(date);
String d = format.format(date);
System.out.println(d);
}