PHP How do I calculate relative time?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2690504/php-producing-relative-date-time-from-timestamps">PHP: producing relative date/time from timestamps</a>  </p>
</blockquote>



<p>Given a specific DateTime value, how do I display relative time, like</p>

<ul>
<li>35 minutes ago  </li>
<li>2 hours ago </li>
<li>3 days ago</li>
<li>1 month ago</li>
</ul>

<p>etc, etc...?</p>

<pre><code>mysql_query("UPDATE users SET lastlogin = ".time()." WHERE id = ".$userID); 
</code></pre>
