title: Calculate difference between two dates and store in session
body: <p>I'm trying to calculate difference between two dates and store the result in session then later to use it. The problem is when I show the result it's shows <code>0</code>. Here is how I trying:</p>
  
  <pre><code>$created = ('y:m:d'); // $created comes from db where the row is DATETIME       
  
  $startTimeStamp = strtotime($created);
  $Today=date('y:m:d');
  
  $timeDiff = abs($Today - $startTimeStamp);
  
  $numberDays = $timeDiff/86400;
  
  $numberDays = intval($numberDays);
  
  $_SESSION['created'] = $numberDays;
  </code></pre>