I have a string named DateCompareOld, it has the value \"Fri Aug 12 16:08:41 EDT 2011\". I want to convert this to a date object.
DateCompareOld, it has the value \"Fri Aug 12 16:08:41 EDT 2011\"
SimpleDateFormat
DateFormat dateType = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); dateType.setLenient(false); Date convertDate = dateType.parse(DateCompareOld);