title: How to subtract some Hours from current Time in AngularJS
body: <p>I'm using AngularJS for my application and the date object is $scope.ProductionDate.</p>
  
  <p>From 5:00AM 2017-02-21 (Feb 21st) to 4:59AM 2017-02-22 (Feb 22nd)</p>
  
  <p>I want the ProductionDate value to be 2017-02-21. </p>
  
  <p>P.S. Here Feb 21st is just an example. Daily I want the same value in given timings.</p>
  
  <p>Can I know how to get that?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function Ctrl($scope)
  {
      $scope.ProductionDate = new Date();
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app ng-controller="Ctrl"&gt;
      ProductionDate: {{ProductionDate | date:'yyyy-MM-dd'}}&lt;br/&gt; 
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>