I am getting UTC time from server for eg - "2016-01-04T06:27:23.92". I want to convert it to Jan 4,2016 and time in Local formate. I am using following code but its not working -
Date localTime = new Date(commentDate);
String format = "yyyy/MM/dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(format);
Date gmtTime = new Date(sdf.format(localTime));
Date fromGmt = new Date(gmtTime.getTime() + TimeZone.getDefault().getOffset(localTime.getTime()));
commentDate = commentDate.substring(0, commentDate.lastIndexOf("."));