I want to format this date 2021-12-17T06:23:49.000000Z
to read as Dec 17,2021
. How do I achieve that?
This is what I have tried:
SimpleDateFormat spf=new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS.'Z'");
Date newDate= null;
try {
newDate = spf.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
spf= new SimpleDateFormat("dd MMM yyyy");
date = spf.format(newDate);