I save the datetime in the timestamp line using the following:
date_default_timezone_set('Europe/London');
$bdatetime = "31-03-2016 21:52";
$date = new DateTime($bdatetime);
$bdatetimeTS = $date->getTimestamp();
which saves a fine. And I can get this timestamp and convert it back to its original format using the following command in angular js:
<td>{{item.bdatetime * 1000 | date:'dd-MM-yy'}}</td>
which displays the entire list of entries.
Now I need to edit individual records, in the editing form I have the following field:
<input type="text" ng-model="bdatetime" value="{{bdatetime * 1000 | date:'dd-MM-yy'}}" name="bdatetime" id="datetimepicker" required/>
in JS and binding it using the following:
$scope.bdatetime = data[0].bdatetime;
which shows the timestamp in the input field, and then shows the time date in a format in a specific format.
I know how to convert timestamp to datetime format for non-bindable .
How to do this for a bindable input field?
, .