I'd 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 24 hour based. Is there a way to do that?
The datetime-local
input type specifies a local time without time zone, and the internal representation of the value is in ISO 8601 conformant format, which has no AM/PM. It is left to implementations to decide what localized format might be used in the user interface. Whether they have AM/PM designator is outside the author’s control.
In my environment, of the browsers I regularly use, only Chrome has real support to datetime-local
. It’s qualitatively questionable (using ISO 8601 format), but the point is that has no AM/PM, or even a possibility of entering it. Your mileage will vary, by the language of your browser and/or operating system settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With