Date Util
public class DateUtil {
public static Date StringToDate(String date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd", Locale.ENGLISH);
Date convertedDate = null;
try {
convertedDate = sdf.parse(date);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return convertedDate;
}
}
The String Input when i call it
2018/06/08
The value it returns is
Fri Jun 08 00:00:00 CST 2018