title: Unable to format default MySQL datetime
body: <p>My dates come out of the database looking like this: <code>2013-11-21 17:43:20</code></p>
  
  <p>I'm trying to user Angular's date filter to turn them into something prettier, but...</p>
  
  <pre><code>{{Objected.created | date:'shortDate'}}
  </code></pre>
  
  <p>or </p>
  
  <pre><code>{{Objected.created | date:'YYYY'}}
  </code></pre>
  
  <p>...just spits out the original datetime string: <code>2013-11-21 17:43:20</code>. There are no errors. What am I doing wrong?</p>
  
  <p><strong>Update</strong>
  I see that MySQL's default datetime is incompatible with what Angular's data filter expects. I'm attempting to convert it on the fly like this but it's throwing errors:</p>
  
  <pre><code>&lt;li ng-repeat="result in data"&gt;{{ new Date(result.Job.created).toISOString() | date:'shortDate'}}&lt;/li&gt;
  </code></pre>
  
  <p>I suspect I can't instantiate the Date class in the way I'm trying. The error is a $parse:syntax error.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Thanks to @m59's help, I got it working with a few minor adjustments...</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;html ng-app="myApp"&gt;
  ...
  {{Object.created | dateToISO | date:'shortDate'}}
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var myApp = angular.module('myApp',[]);
  
  myApp.filter('dateToISO', function() {
    return function(input) {
      input = new Date(input).toISOString();
      return input;
    };
  });
  </code></pre>
  
  <p>This custom filter converts the default MySQL datetime into the format that the date filter expects, so I send it throw one then another and "voila".</p>