How to set a format in bootstrap 3 datetimepicker. I want the format "dd/MM/yyyy hh:mm" and I dont want "AM" and "PM". For that in which language I can use here. The following fiddle How can I do this?
http://jsfiddle.net/Eonasdan/0Ltv25o8/
$('#datetimepicker1').datetimepicker({
format : "dd/MM/yyyy hh:mm",
});
<!-- padding for jsfiddle -->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="input-group date" id="datetimepicker1">
<input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span>
</div>
</div>
</div>
</div>
I'm not sure why yours isn't working, using
dd/MM/yyyy hh:mm
gives the outputWe/04/yyyy 08:43
. If you want the output to be for example01/03/2015 12:01
you need to setformat : "DD/MM/YYYY hh:mm"
. For more information on format options take a look at the momentjs documentation.See updated jsfiddle
You need to make sure that you include all of the necessary css and js files that the datetimepicker needs to work. You also need momentjs and jquery to load first. See code snippet.
adding data-date-format="YYYY-MM-DD HH:mm" in the input tag also works.