简体   繁体   中英

force 24 hour notation in html 5 input element of type time

I have been trying to use the new html5's input element of type 'time' to create a timepicker in my application.

After surfing the web about this issue for quite some time I have figured out that the time format in this input element is determined by:

  • Timezone / time settings in the computer which is running the browser
  • The browser itself

In some browsers I get the 12-hour notation with AM/PM displayed inside the element. Is there any way to force a 24-hour notation?

Code:

<input type="time"/>

这取决于您的浏览器时间设置,设为 24 小时,然后它会显示 24 小时时间。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM