String to parse used to date, with the date format converted into String
Set the date format with SimpleDateFormat
formatter = new SimpleDateFormat( "yyyy-MM-dd "); String date = formatter.format(new Date());
formatter = new SimpleDateFormat( "yyyy-MM-dd "); String s = "2011-07-09 "; Date date = formatter.parse(s);