Displaying the Time in AM/PM format in android -


i getting time using time picker , displaying time in text view using following code...

private timepickerdialog.ontimesetlistener mtimesetlistener = new timepickerdialog.ontimesetlistener() {     public void ontimeset(timepicker view, int hourofday, int minute) {         toast.maketext(sendmail.this, "your appointment time "+hourofday+":"+minute,    toast.length_short).show();         textview datehid = (textview)findviewbyid(r.id.timehidden);         datehid.settext(string.valueof(hourofday)+ ":"+(string.valueof(minute)));     } }; 

now, issue when set time 8:00 pm time displayed 20:0... want display time 8:00 pm... how can that???

private string getreminingtime() {     string delegate = "hh:mm aaa";     return (string) dateformat.format(delegate,calendar.getinstance().gettime()); } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -