I am new to android. I am using a database to store my data. I also store date as TEXT in database. format of date is as follow…
“Mon, 20 Oct 2010 12:30:00”
So i stored them in TEXT datatype not in DateTime. Now i want to display them in following format
“Mon, 20 Oct 2010” The main thing is that i want to ORDER them in DESC. I write a query for this but it dose not work. It there is some alternative for this???? i also read about “strftime()” function of SQLITE but i did not know how to use it for this.
My Query is:
“Cursor c = myDB.rawQuery(“Select * from List ORDER BY to_date(substr(date,6,20), ‘DD-MM-YYYYTHH24:MI:SS’) DESC”,null);”
Please Help me… Thanks in advance!
Finally i store date as text format and then after retrieve i sort date by sending my text(date) value to the constructor of Date class. And the using that object i sort them and adjust items related to that dated in proper location by Insertion Sort logic. 🙂