最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Datetime local 24h format - Stack Overflow

programmeradmin3浏览0评论

i want to use the the 24 hour format in my datetime picker im my view here the code of my view i am using the simple datetime local

<input id="start_date" type="datetime-local" class="form-control>

the result:

i tried this

<script type="text/javascript">
  $('#clockPicker').timepicker({
      'timeFormat':'H:i'
  });
</script>

i want to use the the 24 hour format in my datetime picker im my view here the code of my view i am using the simple datetime local

<input id="start_date" type="datetime-local" class="form-control>

the result:

i tried this

<script type="text/javascript">
  $('#clockPicker').timepicker({
      'timeFormat':'H:i'
  });
</script>
Share Improve this question edited Jun 11, 2020 at 22:15 John Conde 220k99 gold badges462 silver badges501 bronze badges asked Jun 11, 2020 at 22:15 yassinyassin 811 gold badge1 silver badge9 bronze badges 3
  • 1 You have a typo: class="form-control> – djcaesar9114 Commented Jun 11, 2020 at 22:16
  • And which datepicker are you using? – djcaesar9114 Commented Jun 11, 2020 at 22:16
  • What js library are you using for timepicker, you will find option it it documentation for sure – karmendra Commented Jun 11, 2020 at 22:22
Add a ment  | 

1 Answer 1

Reset to default 4

Referring to Mozilla reference, it is NOT possible to choose the date format.

If you want to use 24H format, you can change your system preferences. The date format is based on your system preferences.

https://developer.mozilla/en-US/docs/Web/HTML/Element/input/time#:~:text=The%20value%20of%20the%20time%20input%20is%20always%20in%2024,always%20hh%3Amm%3Ass%20.

发布评论

评论列表(0)

  1. 暂无评论