I am trying to convert this String into date/time format
I am getting this string from the database and just want to convert it into proper date and time...
String str = 2019-02-22T13:43:00Z;//input
I am getting proper date from this string by this code:
String[] split_date = date_time.split("T",2);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date1 = format.parse ( split_date[0]);
date_time = new SimpleDateFormat("dd-MMM-yyyy hh:mm", Locale.ENGLISH).format(date1);
In above code (date_time = 22-Feb-2019 12:00) is coming.
expected output is : 22-feb-2019 13:43
The problem here is I can't get the proper time from that default format.