This method must return a result of type Date
in
Programming Questions
•
2 years ago
I tried other ways aswell which provided me other errors...
How do i fix this?
How do i fix this?
- public Date stringToDate(String date) {
DateFormat stampFormat = new SimpleDateFormat("MM-dd-yyyy");
if(date.equals("null") == false) {
date = date.replace("/", "-");
try {
//Date firstDate = stampFormat.parse(date1);
Date returnDate = stampFormat.parse(date);
return returnDate;
//return Date = stampFormat.parse(date);
}
catch (ParseException e) {
die("Problem with dates", e);
}
}
}
1