title: Sorting JSON objects on the basis of timestamp
body: <p>I have a array of JSON objects each having date as one of the fields.</p>
  
  <pre><code>var array = [{id: 1, date:'Mar 12 2012 10:00:00 AM'},{id: 2, date:'Mar 8 2012 08:00:00 AM'}]
  </code></pre>
  
  <p>I want to sort the objects in descending order on the basis of the time stamp. I have written a utility for it. i.e.</p>
  
  <pre><code>var sortedData= array .sort((function (a, b) { return new Date(b.date) - new Date(a.date) }));
  </code></pre>
  
  <p>but the above utility sorts on the basis of only date .i.e mar 12 and mar 8 in above case. It doesn't take into consideration the time factor which is 10.00 AM and 8.00 AM. How the sorting can be done using both the parameters, date as well as time.</p>