I have a string with contains date time retrieved from webservice in the form "2014-11-12 16:19:00"
I need to extract only the time in 12 hr format AM or PM .
I tried but not got desired result .
public Date validateBreakingNewsDateDate() throws Exception{
Date date = null;
String dtStart = "2014-11-12 16:19:00";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
date= format.parse(dtStart);
Log.e("date", "kardate "+date);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return date;
}