1var date = $("#datetimepicker1").data("datetimepicker").getDate(),
2 formatted = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours + ":" + date.getMinutes() + ":" + date.getSeconds();
3alert(formatted);