title: How do I check if system is 12 or 24 hour?
body: <p>I am trying to determine if the current locale is set to 12 or 24 hour, and set am/pm accordingly. This is what I have got right now, but it shows am/pm all the time regardless if it is set to 24.</p>
  
  <pre><code>if (DateFormat.is24HourFormat(this))
  {
      mHour = mCalendar.get(Calendar.HOUR_OF_DAY);
      int hourOfDay = mHour;
      if (hourOfDay&gt;12)
          views.setTextViewText(R.id.AMPM, "pm");
      if (hourOfDay==12)
          views.setTextViewText(R.id.AMPM, "pm");
      if (hourOfDay&lt;12)
          views.setTextViewText(R.id.AMPM, "am");
  }
  else {
      views.setTextViewText(R.id.AMPM, "");           
  }
  </code></pre>