How to convert the string to a date
In the string we have a timestamp (for example "2018-07-11T04:40:30Z"
),
and I want to simply convert this String time to 11-07-2018 16:40:30
String Time = jresponse.getString("timestamp");
SimpleDateFormat sf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date = sf.parse(Time);
I tried many times this code and it doesn't work because I have always this format "2018-07-11T04:40:30Z"
and not this 11-07-2018 16:40:30
why ?