bootstrap datetime picker with 12 hour clock not displaying the meridian(am or pm) in rails?

北慕城南 提交于 2019-12-01 06:40:51

问题


i want to display the date_time format in this way 11/01/2013 12:00 AM but currently it is displaying 11/01/2013 12:00 P like this. the meridian indicator "P" always showing "P" instead of showing am or pm.

i am following this link bootstrap date time picker for my rails app.

$('#datetimepicker1').datetimepicker({
             format : 'DD/MM/YYYY hh:mm P'   
        });

回答1:


$('#datetimepicker1').datetimepicker({
             format : 'DD/MM/YYYY hh:mm a'   
        });

gives DD/MM/YYYY hh:mm am

or

$('#datetimepicker1').datetimepicker({
             format : 'DD/MM/YYYY hh:mm A'   
        });

gives DD/MM/YYYY hh:mm AM




回答2:


I can´t test it at the moment. But id should be

format : 'DD/MM/YYYY hh:mm A'

or

format : 'DD/MM/YYYY hh:mm a'

for big or small pm.




回答3:


You can use

format: 'DD-MM-YYYY hh:mm A'

or

format: 'DD-MM-YYYY hh:mm:ss A'

or

format: 'DD-MM-YYYY - hh:mm:ss A'

or

format: 'DD-MM-YYYY :: hh:mm:ss A'

or

any other such possible combination. Here the A in the end of format is responsible for showing AM or PM




回答4:


any of the above solution is not worked for me I have tried this, hope this help anyone

 format: 'dd/mm/yyyy hh:ii p'

where

  • dd - Date
  • mm - month
  • yyyy - year
  • hh - hour
  • ii - minute
  • p - show am/pm

This link is very useful



来源:https://stackoverflow.com/questions/31270293/bootstrap-datetime-picker-with-12-hour-clock-not-displaying-the-meridianam-or-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!