I need to convert a string in the format "dd/mm/yyyy", to a long type. In order to pass the value to the calendarProvider in android.
Currently I have:
Calendar calendar = Calendar.getInstance();
long startEndDate = 0;
Calendar currentDateInfo = Calendar.getInstance();
currentDateInfo.set(calendar.get(Calendar.YEAR), calendar.SEPTEMBER, calendar.get(Calendar.DAY_OF_MONTH));
startEndDate = currentDateInfo.getTimeInMillis();
I need:
long startDate = *Some sort of conversion* EditText.getText();
I've tried using SimpleDateFormat but i'm having problems getting the correct type back. Any help would be much appreciated.
SimpleDateFormat
- it is the correct way to go. – Herbert