Bootstrap Datetimepicker set date
As per documentation you can use string, Date, moment, null
, string and Date examples are below. Note default picker format.
$('#datetimepicker1').data("DateTimePicker").date(new Date())
or
$('#datetimepicker1').data("DateTimePicker").date('1/11/2016 12:23:12')
Sure, i'm real Necromancer, but i got same problem and .date() function does not help for me. But, i found this:
$('#datetimepicker1').data("DateTimePicker").options({ defaultDate: newdate});
// newdate - could be Date, Moment or ISO string