how to set am/pm format in jquery using datetimepicker

Try

$('#occasionStartTime').datetimepicker({
    datepicker : false,
    ampm: true, // FOR AM/PM FORMAT
    format : 'g:i A'
});

$('#StartDate').datetimepicker(
                {
                    format: 'DD MMM YYYY hh:mm A'

                });

where startDate is a divId

    <div class="input-group date form_datetime" id="StartDate">
         <input type="text" class="form-control input-lg" placeholder="From" name="StartDate" id="txtStartDate" required /> 
<span class="input-group-addon">
<span class="glyphicon-calendar glyphicon"></span></span>
 </div>

This will give you format like: 25 Mar 2016 01:08 PM


$('#occasionStartTime').datetimepicker({
        format: 'Y/m/d A g:i',
        formatTime: 'A g:i',
    });

Tags:

Jquery