Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

html

input

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?

like image 523
wrdana Avatar asked Mar 11 '14 17:03

wrdana


1 Answers

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.

like image 86
Jukka K. Korpela Avatar answered Sep 24 '22 20:09

Jukka K. Korpela