I have a database which stores value in yyyy-MM-dd HH:mm:ss format.
When I retrieve values, I want them to be displayed in dd-MM-yyyy HH:mm AM/PM format. I cannot change the way I store them in the first place.
I am using a Cursor to get results from the database and then add them to a list, which is then used by listadapter to populate the listview.
Since Cursor returns a string how can I change the format of the returned value?
you can use SimpleDateFormat with the pattern like “
dd-MM-yyyy HH:mm a“.