title: Getting wrong year while conveting using PHP date function
body: <p>I am getting some wrong year while converting date field value using php <code>date</code> function. I am providing my code below.</p>
  
  <pre><code>usort($result, function($a, $b) {
              $ad = DateTime::createFromFormat('m/d/Y H:i:s A', $a['date'])-&gt;format('m/d/Y H:i:s A');
              $bd = DateTime::createFromFormat('m/d/Y H:i:s A', $b['date'])-&gt;format('m/d/Y H:i:s A');
                            if ($ad == $bd) {
                              return 0;
   }
       return $ad &gt; $bd ? -1 : 1;
  });
  echo json_encode($dataArr);
  </code></pre>
  
  <p>This is giving the below output.</p>
  
  <pre><code>[{"message":"HAPPY HOUR has removed from the business Royalcausine","image":"","rest_name":"Royalcausine","member_id":"254","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"1","day_name":"Monday","city_id":"2","city_name":"Bhubaneswar","noti_id":"76","special_id":"1","date":"12/04/2017 20:50:52 PM"},{"message":"FREE TODAY TECH 1212","image":"","rest_name":"Swagat restaurant","member_id":"244","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"1","day_name":"Monday","city_id":"2","city_name":"Bhubaneswar","noti_id":"84","special_id":"1","date":"12/04/2017 15:31:57 PM"},{"message":"happy hour 90% discount updated by subhra","image":"","rest_name":"1st choice","member_id":"189","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"4","day_name":"Thursday","city_id":"2","city_name":"Bhubaneswar","noti_id":"68","special_id":"1","date":"12/01/2017 11:35:52 AM"},{"message":"Why to wait?grab now","image":"","rest_name":"kolaberi","member_id":"245","subcat_id":"57","subcat_name":"COCKTAILS","day_id":"4","day_name":"Thursday","city_id":"2","city_name":"Bhubaneswar","noti_id":"67","special_id":"1","date":"11/30/2017 14:23:10 PM"},{"message":"Great offers now 23%","image":"","rest_name":"kk","member_id":"241","subcat_id":"47","subcat_name":"LATE NIGHT","day_id":"2","day_name":"Tuesday","city_id":"2","city_name":"Bhubaneswar","noti_id":"6","special_id":"1","date":"11/28/2017 17:33:47 PM"},{"message":"90% discount","image":"","rest_name":"Swagat restaurant","member_id":"244","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"2","day_name":"Tuesday","city_id":"2","city_name":"Bhubaneswar","noti_id":"5","special_id":"1","date":"11/28/2017 17:08:33 PM"}]
  </code></pre>
  
  <p>again I am converting the date field value like below.</p>
  
  <pre><code>foreach ($result as $key =&gt; $value) {
      $result[$key]['date']=date("jS F, Y h:i:s A", strtotime($value['date']));
  }
  </code></pre>
  
  <p>And finally it's giving the output like below.</p>
  
  <pre><code>[{"message":"HAPPY HOUR has removed from the business Royalcausine","image":"","rest_name":"Royalcausine","member_id":"254","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"1","day_name":"Monday","city_id":"2","city_name":"Bhubaneswar","noti_id":"76","special_id":"1","date":"1st January, 1970 01:00:00 AM"},{"message":"FREE TODAY TECH 1212","image":"","rest_name":"Swagat restaurant","member_id":"244","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"1","day_name":"Monday","city_id":"2","city_name":"Bhubaneswar","noti_id":"84","special_id":"1","date":"1st January, 1970 01:00:00 AM"},{"message":"happy hour 90% discount updated by subhra","image":"","rest_name":"1st choice","member_id":"189","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"4","day_name":"Thursday","city_id":"2","city_name":"Bhubaneswar","noti_id":"68","special_id":"1","date":"1st December, 2017 11:35:52 AM"},{"message":"Why to wait?grab now","image":"","rest_name":"kolaberi","member_id":"245","subcat_id":"57","subcat_name":"COCKTAILS","day_id":"4","day_name":"Thursday","city_id":"2","city_name":"Bhubaneswar","noti_id":"67","special_id":"1","date":"1st January, 1970 01:00:00 AM"},{"message":"Great offers now 23%","image":"","rest_name":"kk","member_id":"241","subcat_id":"47","subcat_name":"LATE NIGHT","day_id":"2","day_name":"Tuesday","city_id":"2","city_name":"Bhubaneswar","noti_id":"6","special_id":"1","date":"1st January, 1970 01:00:00 AM"},{"message":"90% discount","image":"","rest_name":"Swagat restaurant","member_id":"244","subcat_id":"42","subcat_name":"HAPPY HOUR","day_id":"2","day_name":"Tuesday","city_id":"2","city_name":"Bhubaneswar","noti_id":"5","special_id":"1","date":"1st January, 1970 01:00:00 AM"}]
  </code></pre>
  
  <p>Here I noticed the year <code>2017</code> is converting into <code>1970</code> which is a wrong value. Finally I need this date format  like <code>28th Nov, 2017 17:08:33 PM</code>.</p>