1.String ->Date
String StrDate = "2012-12-12";
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date(); date=sdf.parse(StrDate);
2.Date ->String
String StrDate = "";
Date date = new Date();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
StrDate= sdf.format(date);