A jQuery script is used to pick date and time. The format is "Sunday 31 January 2016 - 00:55". I want to run mysql to find date-time interval. But it is not in TIMESTAMPDIFF format. So how to find the interval?
I used this script for picking date & time http://www.jqueryscript.net/time-clock/Pretty-Date-Time-Picker-Plugin-For-Bootstrap-Material.html
My solution was:
$d = "Sunday 31 January 2016 - 00:55";
$date = date("Y-m-d H:i",strtotime($d));
You just have to add the format to the options object of your datetime picker to get the date in the required format:
$('#yourElement').bootstrapMaterialDatePicker({
format : 'YYYY-MM-DD'
});