I need to store time which is entered from angular js frontend.The time format is
HH: MM AM/PM.
When I console log time I am getting user entered time like
Thu Jan 01 1970 01:01:00 GMT+0530 (India Standard Time) but in my database time value is 00:00:00
What I have tried:
Angular js
<input type="text" ng-model="name" >
<input type="time" ng-model="booktime">
Controller
$http.post("url", {
name=name;
booktime=booktime;
})
.then(function(response){
console.log("Data Inserted Successfully");
console.log(booktime);
});
Mysql
booktime coloumn datatype is Time
$data = json_decode(file_get_contents("php://input"));
<pre>$name = $data->name;
$booktime=$data->booktime;
$sql = "INSERT INTO cust(name,booktime)VALUES ('$name','$booktime')";