Is there any way that I could convert time in this format 2640 Hrs : 00 Mts
to 14:22:57 hrs
.
I tried a lot of ways and nothing seems to be working. I really need help.
Json Array
{"ElapsedTime":"2642 Hrs : 59 Mts"}
Code I tried
DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss");
Date date = dateFormat.parse(jsonDate);
return dateFormat.format(date);
The above code throws this exception
java.text.ParseException: Unparseable date: "2640 Hrs : 00 Mts" (at offset 4)
I'm using Volley GsonRequest and I'm able to parse it but unable to format time.