I'm trying to modify an existing notepad example from the Android Developer site. I have a database with an existing column named CREATED_DATE
(of the note) but the data for that column is presented as System.currentTimeMillis()
. This is all good and probably in line with conventions since it's created by the developers.
But my problem is that I want to present the date in a ListView
using the format "30 sep"
. My problem, how do I convert the data to that format before presenting it in the ListView
? Right now I'm using this kind of adapter:
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.noteslist_item, cursor,
new String[] { Notes.TITLE, Notes.CREATED_DATE }, new int[] { R.id.note_title, R.id.note_date });
setListAdapter(adapter);
Now, I've figured out how to convert currentTimeMillis()
to today's date but how can I convert the data coming from the cursor before I toss it into the adapter?