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'
});
$('#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
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.
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
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