title: AngularJs: format current date inside the controller
body: <p><strong>THE SITUATION:</strong></p>
  
  <p>Inside the controller i need to get the current date in order to compare it with other data. </p>
  
  <p>The code is pretty simple:</p>
  
  <pre><code>var today = new Date();
  </code></pre>
  
  <p>In this way i get the current date in this exact format: </p>
  
  <pre><code>2015-12-24T12:03:58.170Z
  </code></pre>
  
  <p>I need to format it in order to keep only year-month-day (yyyy-MM-dd)</p>
  
  <p>I know how to format the date in the view but i don't know how to do it inside the controller.</p>
  
  <p><strong>THE QUESTION:</strong></p>
  
  <p>How can i format the current date inside the controller?</p>
  
  <p>Thank you!</p>