Bootstrap datetime picker with 12 o'clock hour not showing meridian (am or pm) in rails?

I want to show the date_time format this way 11/01/2013 12:00 AM

, but currently it displays 11/01/2013 12:00 P

like this. meridian indicator "P" always shows "P" instead of reading 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'   
        });

      

+2


source to share


4 answers


$('#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

+12


source


I cannot verify this at the moment. But the identifier must be

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

      

or



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

      

for a big or small evening.

+3


source


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 A at the end of the format is responsible for displaying AM or PM

+2


source


any of the above solutions doesn't work for me, i tried this, hope it helps someone

 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 helpful

0


source







All Articles