here is the code
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd kk:mm:ss";
public static final String KEY_DATE_TIME = "reminder_date_time";
SimpleDateFormat datetimeFormat = new SimpleDateFormat(DATE_TIME_FORMAT) ;
try {
String dateString = reminder.getString(reminder.getColumnIndexOrThrow(ReminderDbAdapter.KEY_DATE_TIME));
Date date = (Date) datetimeFormat.parse(reminder.getString(dateString);
mCalendar.setTime(date);
} catch (java.text.ParseException e) {
Log.e("edit_activity", e.getMessage(), e);
}
it is not parsing date as all the values are fetched but date is not parsed so logcat is showing an error.
error::06-11 14:08:59.320: E/edit_activity(361): java.text.ParseException: Unparseable date: 2012-03-11 13:14:49
pleaseee help me out
There is no need to give ‘T’, in DateFormat, instead you can specify SimpleDateFormat as below: