如何在html5日期时间选择器中将格式从12小时更改为24小时? [英] How to change format from 12hrs to 24 hrs in html5 datetime picker?

查看:2253
本文介绍了如何在html5日期时间选择器中将格式从12小时更改为24小时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用来自Html5的日期时间选择器。

I am using datetime picker from Html5.

      <input id="datetime"  type="datetime-local">

但它包含12小时的AM或PM时间,但我想设置上午24点的地方,PM

But It is containing 12 Hrs time with A.M or P.M, But I want to set 24 hrs place of A.M, P.M.

我正在引用此链接 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local

我的问题是我只想及时设置24小时。

My problem is only I want to set 24 hrs in time.

推荐答案

您可以使用 input type =time但这取决于启动Web浏览器时用户操作系统的时间格式。您可以更改操作系统时间格式并重新启动浏览器以进行检查。

You can use input type="time" but It depends on the time format of the user's operating system when the web browser was launched. You can change your OS time format and restart your browser to check.

这不支持所有浏览器,如果你使用bootstrap最好使用 http://jdewit.github.io/bootstrap-timepicker/

This doesn't support all browser, if you are working with bootstrap is better to use http://jdewit.github.io/bootstrap-timepicker/

这篇关于如何在html5日期时间选择器中将格式从12小时更改为24小时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆