I have a time picker function which sets time in an EditText . But the format it shows is not suitable. for example for 04:07pm is shown as 4:7. whenever the digit in time is l
i might be little late to the party but this will surely help to someone else.
private String getTime(int hr, int min) {
Time tme = new Time(hr, min, 0);//seconds by default set to zero
Format formatter;
formatter = new SimpleDateFormat("h:mm a");
return formatter.format(tme);
}