Q:

Conversion of DateTime in java

One of the fields of my json is a String which contains time in the following format: 2017-04-04T20:22:33 or even 2017-04-07T12:21:10.0355277+00:00. My task is to convert it to a more simple representation like this: "Apr-4 20:22". I was thinking about about creating a SimpleDateFormat, however it doesn't seem to work with such DateTime format. 
Is there any effective way to handle this task?

A:

Try this
 String date="2017-04-04T20:22:33";
 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
 SimpleDateFormat sdf1 = new SimpleDateFormat("MMM-dd HH:mm");
 try{
    Date parseDate = sdf.parse(date);
    String output = sdf1.format(parseDate);
 }catch(Exception e) {

 }

