java - extract date-month-year from retrieved date -


i getting system current date , trying display in textview.

after trying below code

private onclicklistener listener1 = new onclicklistener() {      @override     public void onclick(view arg0) {         long dtmili = system.currenttimemillis();         date dt = new date(dtmili);         gett.settext(dt.tostring());      } }; 

what is

enter image description here

but want 15/7/2013.

i think need this:

simpledateformat sdf = new simpledateformat("dd/mm/yyyy"); string date = sdf.format(dt); 

also see customizing formats.


Comments