I want to convert the "H:mm" value of time that i am getting from my Firestore database to "h:mm a" but i am not able to, getting "Unparseable date" and sometimes just plain it's not working.
val strTime = studentAttendanceList[position].Time.toString() //time from firebase store in "H:mm" format
val dateFormat: DateFormat = SimpleDateFormat("h:mm")
val date = dateFormat.parse(strTime)
val f2 = SimpleDateFormat("HH:mm a")
f2.format(date).lowercase()
I want to get this time in
h:mm a
For example -
16:00 to 4:00 pm