I use a time input in my website. It works 24 hours format according my system setting.
I try to use browser mobile mode, also works 24 hours.
But when I use a mobile phone to test, the time control shows in 24 hours mode, but when you click time set, the input text box will shown as 12 hours mode(my phone has set 24 hours format).
e.g. My contorl shows 24-hour format (not AM|PM), I select time 13:16
by control, the text box will shown as 1:16 PM
.
Are there any methonds force it shows in 24 hours format?
<form>
...
<input type="time" ... />
</form>
I have read MDN documents abount <input type="time" ...>
. But the problem is my test phone has 24-hour format local setting.
I have try to modify my mobile browser user-agent (in four different browsers). It always shows in 12-hour format, and one of them also shows second but mistooken show PM as AM.
I take a test by setting my moblie local time setting to 12-hour format, the contorl will turn to 12-hour format (ask me to choose AM or PM). And UI is the same.
The value of the time input is always in 24-hour format that includes leading zeros: hh:mm, regardless of the input format, which is likely to be selected based on the user's locale (or by the user agent).