6

When I add the HTML5 time input element, it shows me:

__:__:__

It seems to be in a 24-hour (military/european) hour mode. How can I get it to append an "am/pm" indicator (and, as I noted in a prior question, I don't need/want the seconds portion, either)?

Community
  • 1
  • 1
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 2
    Be aware that date/time inputs do not have complete browser support – charlietfl Aug 24 '15 at 14:25
  • I think that you will need to write your own component that support 12 hours. Or search for jQuery plugin http://www.sitepoint.com/10-jquery-time-picker-plugins/ – jcubic Aug 24 '15 at 14:28
  • 1
    (Alteast) In Chrome the value seems to get automatically converted to AM/PM and there is button to change it also. This [fiddle](http://jsfiddle.net/hari_shanx/946s28zw/) has fix for one of your 3 recent questions whereas the other 2 work by default in Chrome. – Harry Aug 24 '15 at 14:31
  • 1
    Up to now this is defined by each browser implementation: http://www.w3schools.com/html/html_form_input_types.asp Looks like there is no way to set the format. A solution could be use a default input text with a jquery plugin. – Ricardo Pontual Aug 24 '15 at 14:33

1 Answers1

1

Possible duplicates : html5 time inputs shows 12 hours and HTML5 changing <input type="time"> to 24hrs. format? it is possible

Seems like some people are stuck with 24 hours and others 12 hours with AM/PM. Here's what I found out. For me, I was stuck on a 24 hour mode and changing the Operating system's date format didn't work for me (at least not right away probably due to chrome previously installed). So I went in google chrome's settings -> Show Advanced Settings -> Languages -> Language and input settings... Then I switched to English (United States), restart Chrome and Voilà, 12 hour mode selection and able to select AM or PM. So it is probably designed so you don't have to worry about it and that it will be displayed to the user's date/time format preferences. I do not think it is possible AT THE MOMENT to force how it will render as described in this answer Is there any way to change input type="date" format?.

The format displayed by the user interface control and accepted as user input. Browser vendors are encouraged to follow the user's preferences selection. For example, on Mac OS with the region "United States" selected in the Language & Text preferences pane, Chrome 20 uses the format "m/d/yy".

Community
  • 1
  • 1
user627283
  • 533
  • 5
  • 19