an...">

How can I use datetime-local without AM / PM?

I would like to use the following code:

<input type="datetime-local" name="date" value="" /> 

and would like it to be without AM / PM and instead be based on 24 hours. Is there any way to do this?

+11
html input html5
source share
2 answers

datetime-local input type indicates local time without a time zone, and the internal representation of the value corresponds to ISO 8601, which does not have AM / PM. Other implementations can decide which localized format can be used in the user interface. Regardless of whether they have an AM / PM index outside the control of the authors.

In my browser environment, which I regularly use, only Chrome has real datetime-local support. Its qualitatively dubious (using the ISO 8601 format), but the fact is that it does not have AM / PM or even the ability to enter it. Your mileage will depend on your browser language and / or operating system settings.

+4
source share

You can not. Till.

This feature is still in the HTML5 project, and each browser does these elements differently.

What you can do is use a custom date and time collection with / or a lot of JavaScript, but with HTML5 this is not possible.

+3
source share

All Articles