m7md m7md - 27 days ago 10
Javascript Question

bootstrap date time picker change format

I'm using a bootstrap date time picker to select a date with the time his format is like this mm/dd/yyyy hh:ii i want to change this format to dd/mm/yyyy hh:ii

I had used this method but i didn't have the format i want the same format still appear

<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
format: "dd/mm/yyyy hh:ii"
});
});
</script>


Html Code:

<input type="text" value="" id="datetimepicker1" name="txt_padd"
placeholder="Actual Date" class="form-control input-md" onchange="call()"
onkeyup="saveValue(this);" >


How Can i Change the format of this datetimepicker ??!!

Answer

Check this out

DEMO

$('#datetimepicker2').datetimepicker({
   format: 'DD/MM/YYYY HH:mm'
});