TimePickerDialog.OnTimeSetListener timpickListener = new TimePickerDialog.OnTimeSetListener() {
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
dateAndTime.set(Calendar.HOUR_OF_DAY, hourOfDay);
dateAndTime.set(Calendar.MINUTE, minute);
mTextViewTime.setText((String) (DateFormat.format("h:mm aa", dateAndTime.getTime())));
// mTextViewTime.setText(hourOfDay + ":" + minute);
mReminder.setRemindTime((String) (DateFormat.format("h:mm aa", dateAndTime.getTime())));
}
};
Formatting characters may be repeated in order to get more detailed representations of that field. For instance, the format character 'M' is used to represent the month. Depending on how many times that character is repeated you get a different representation.
For the month of September:
M -> 9
MM -> 09
MMM -> Sep
MMMM -> September
The effects of the duplication vary depending on the nature of the field. See the notes on the individual field formatters for details. For purely numeric fields such as HOUR
adding
more copies of the designator will zero-pad the value to that number of characters.
For 7 minutes past the hour:
m -> 7
mm -> 07
mmm -> 007
mmmm -> 0007
Examples for April 6, 1970 at 3:23am:
"MM/dd/yy h:mmaa" -> "04/06/70 3:23am"
"MMM dd, yyyy h:mmaa" -> "Apr 6, 1970 3:23am"
"MMMM dd, yyyy h:mmaa" -> "April 6, 1970 3:23am"
"E, MMMM dd, yyyy h:mmaa" -> "Mon, April 6, 1970 3:23am&
"EEEE, MMMM dd, yyyy h:mmaa" -> "Monday, April 6, 1970 3:23am"
"'Noteworthy day: 'M/d/yy" -> "Noteworthy day: 4/6/70"