Question: I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.

```
    timePicker = (TimePicker) findViewById(R.id.timePicker1);
    timePicker.setIs24HourView(true);

```

I even tried timePicker.setCurrentHour(cal.HOUR\_OF\_DAY) after setIs24HourView, but I am not able to see the 24 hour format on the TimePicker.

```
<TimePicker
    android:id="@+id/timePicker1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="110dp" />

```

Am I missing anything here?

![enter image description here](https://i.stack.imgur.com/UHJoY.jpg)

Answer: 
ok, I see what the problem is now. 
It's not correctly setting the currentHour to the new 24 hour format, which is why you got 9:05 instead of 21:05. I'm guessing it isn't 9am where you are!
It is a bug, as mentioned in this [question](https://stackoverflow.com/questions/13662288/timepicker-hour-doesnt-update-after-switching-to-24h)
seems the only work around, for now, is to do something like:

```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
timePicker.setCurrentHour(Calendar.get(Calendar.HOUR_OF_DAY));

```

I see you tried cal.HOUR\_OF\_DAY, but didn't provide the code you actually used, but try this and see if it helps.
You can just use the device settings and thus let the user make this decision;

```
 String clockType = android.provider.Settings.System.getString(context.getContentResolver(), android.provider.Settings.System.TIME_12_24);

```