1.date->String
Calendar cal = Calendar.getInstance();
java.util.Date time = cal.getTime();
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(time);
2.String->date
SimpleDateFormat sdf=new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
Date d=sdf.parse("2007-10-03 10:10:10");