By using this code :
SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");
Date date = format.parse(dtStart);
return date;
Consider using the java.util.Calendar class.
String dateString = "20/12/2018";
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Date readDate = df.parse(dateString);
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(readDate.getTime());
Log.d(TAG, "Year: "+cal.get(Calendar.YEAR));
Log.d(TAG, "Month: "+cal.get(Calendar.MONTH));
Log.d(TAG, "Day: "+cal.get(Calendar.DAY_OF_MONTH));