Stifler Stifler - 1 year ago 301
HTML Question

HTML input time in 24 format

I am using below HTML tag:

<input type="time" />

In Chrome, Its showing PM/AM format, can we restrict to display 24 format always.
I dont want to use HTML5 tag

Answer Source

As stated in this answer not all browsers support the standard way. It is not a good idea to use for robust user experience. And if you use it, you cannot ask too much.

Instead use time-picker libraries. For example: TimePicker.js is a zero dependency and lightweight library. Use it like:

var timepicker = new TimePicker('time', {
  lang: 'en',
  theme: 'dark'
timepicker.on('change', function(evt) {
  var value = (evt.hour || '00') + ':' + (evt.minute || '00');
  evt.element.value = value;

<script src=""></script>
<link href="" rel="stylesheet"/>

  <input type="text" id="time" placeholder="Time">

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download