Thursday 14 December 2017

java - Format Date from yyyy-MM-dd'T'hh:mm:ss.SSS'Z'" to Sat 20th May, 06:00

I have a date coming like this as
String



2017-05-20T18:00:56Z



which
I want to convert something like this Sat 20th May,
06:00



How can I do that? I tried below code but
that doesn't seem to be working, also there are many similar post on same but isn't
working out for me





SimpleDateFormat myFormat = new
SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSS'Z'");
try {
Date
myDate = myFormat.parse(actorList.get(position).getPublishedat());

holder.publishedat.setText(myDate.toString());
} catch (ParseException e)
{
e.printStackTrace();

}

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...