android - Change date format of a stored date value in a database? -


i have database stores value in yyyy-mm-dd hh:mm:ss format.

when retrieve values, want them displayed in dd-mm-yyyy hh:mm am/pm format. cannot change way store them in first place.

i using cursor results database , add them list, used listadapter populate listview.

since cursor returns string how can change format of returned value?

you can use simpledateformat pattern "dd-mm-yyyy hh:mm a".

date mdate= new date(system.currenttimemillis()); simpledateformat mdateformat= new simpledateformat("dd-mm-yyyy hh:mm a"); system.out.println(mdateformat.format(mdate)); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -