I am saving datetime in timestamp string using the following:
date_default_timezone_set('Europe/London');
$bdatetime = "31-03-2016 21:52";
$date = new DateTime($bdatetime);
$bdatetimeTS = $date->getTimestamp();
which is saving fine. And I can fetch that timestamp and convert it back to its original format using following in angular js:
<td>{{item.bdatetime * 1000 | date:'dd-MM-yy'}}</td>
which is displaying fine all the list of records.
Now I need to edit individual records, in edit 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 is showing timestamp in input field rather then showing time date in format in the specific format.
I know how to convert timestamp to datetime format for non-bindable.
How can I do this for bindable input field?
This is from string to time stamp but I kind of need a reverse solution from timestamp to input fields.