title: angularjs timestamp to datetime format string in input field
body: <p>I am saving datetime in timestamp string using the following:</p>
  
  <pre><code>date_default_timezone_set('Europe/London'); 
  $bdatetime = "31-03-2016 21:52";
              $date = new DateTime($bdatetime);
              $bdatetimeTS = $date-&gt;getTimestamp();
  </code></pre>
  
  <p>which is saving fine. And I can fetch that timestamp and convert it back to its original format using following in angular js:</p>
  
  <pre><code>&lt;td&gt;{{item.bdatetime * 1000 | date:'dd-MM-yy'}}&lt;/td&gt;
  </code></pre>
  
  <p>which is displaying fine all the list of records. </p>
  
  <p>Now I need to edit individual records, in edit form, I have the following field:</p>
  
  <pre><code>&lt;input type="text" ng-model="bdatetime" value="{{bdatetime * 1000 | date:'dd-MM-yy'}}" name="bdatetime" id="datetimepicker" required/&gt;
  </code></pre>
  
  <p>in JS and binding it using the following:</p>
  
  <pre><code>$scope.bdatetime = data[0].bdatetime;        
  </code></pre>
  
  <p>which is showing timestamp in input field rather then showing time date in format in the specific format.</p>
  
  <p>I know how to convert timestamp to datetime format for <a href="http://docs.angularjs.org/api/ng.filter:date" rel="nofollow noreferrer">non-bindable</a>. </p>
  
  <p>How can I do this for bindable input field?</p>
  
  <p><a href="https://stackoverflow.com/questions/20677970/angularjs-get-timestamp-from-a-human-readable-date">This is from string to time stamp</a> but I kind of need a reverse solution from timestamp to input fields.</p>