i want to format this type of date : Sun Feb 14 12:12:47 GMT+05:30 2016
into SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
this is what i tried:
try {
SimpleDateFormat sdf = new SimpleDateFormat("EE MMM dd HH:mm:ss z yyyy",
Locale.ENGLISH);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
Date pasta = sdf.parse(notesTimeStampArray.get(i));
String newDate = pasta.toString();
Date past = format.parse(newDate);
Date now = new Date();
Toast.makeText(TabFragment2.context, "inside 1 success", Toast.LENGTH_SHORT).show();
}catch (Exception e){
Toast.makeText(TabFragment2.context, "error : " +e.getMessage(), Toast.LENGTH_SHORT).show();
}
but am not succeeding, anyone can correct me ? it'll so helpful for me