How to set the TimePickerDialog to 24 hour?

abhinav.mehra picture abhinav.mehra · Feb 8, 2012 · Viewed 15.8k times · Source

I know how to set the TimePicker widget to 24 hour, how do you do the same for the TimePickerDialog???

Otherwise will I have to make a new dialog box altogether??

Answer

Sergey Benner picture Sergey Benner · Feb 8, 2012

Basically there is a constructor parameter

public TimePickerDialog (Context context, TimePickerDialog.OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView)

and this link might also help you

TimePickerDialog and AM or PM


Cheers