title: Time Difference in Symfony
body: <p>Check the Time Difference in Symfony</p>
  
  <p>i am comparing 2 Times. checking time difference is 4 Hours or Grater ot not.?</p>
  
  <pre><code>$createdAt =  $getCreatedAt-&gt;format('Y-m-d H:i:s');
  $convertCreatedTime = strtotime($createdAt.' + 4 hour');
  $createdTime = date('Y-m-d H:i:s',$convertCreatedTime);
  $todayTime = date("Y-m-d H:i:s");
  
  echo $createdTime."&lt;br /&gt;"; //2017-02-21 04:00:53
  
  echo $todayTime."&lt;br /&gt;"; //2017-02-21 17:32:26
  
  if($todayTime &gt;= $createdTime){ // Check the createdTime 4 Hours Older that Now
      // Yes Older
  }else{
      // No Not Older
  }
  </code></pre>