title: Timestamp not showing minutes correctly since user posted,suggestions?
body: <p>i cannot remember who howver the other day i found a php function on here that i had been looking for to convert my users post time stamp into minutes/hours/weeks since they posted, it works fine all for the first hour and i cant seem to work out why, when a user posts it will say 59 minutes ago and count down to 1 minute then it works as it should from there, any suggestions i will attatch the code</p>
  
  <p>not quite sure on what to try</p>
  
  <pre><code>function time_elapsed_string($datetime, $full = false) {
      $now = new DateTime;
      $ago = new DateTime($datetime);
      $diff = $now-&gt;diff($ago);
  
      $diff-&gt;w = floor($diff-&gt;d / 7);
      $diff-&gt;d -= $diff-&gt;w * 7;
  
      $string = array(
          'y' =&gt; 'year',
          'm' =&gt; 'month',
          'w' =&gt; 'week',
          'd' =&gt; 'day',
          'h' =&gt; 'hour',
          'i' =&gt; 'minute',
          's' =&gt; 'second',
      );
      foreach ($string as $k =&gt; &amp;$v) {
          if ($diff-&gt;$k) {
              $v = $diff-&gt;$k . ' ' . $v . ($diff-&gt;$k &gt; 1 ? 's' : '');
          } else {
              unset($string[$k]);
          }
      }
  
      if (!$full) $string = array_slice($string, 0, 1);
      return $string ? implode(', ', $string) . ' ago' : 'just now';
  }
  </code></pre>