Display date and time something like blog
<p>I have a blog. Regularly I post some fun thing. I maintain the timestamps for response times. How do I display the time like the following?</p>

<ul>
<li><p>2010-02-09 1 hour before, if the reply is just 1 hour old</p></li>
<li><p>2010-02-09 20 hour before, if the reply is just 20 hour old</p></li>
<li><p>2010-02-08 yesterday, if the reply is just 1 day old</p></li>
<li><p>2010-02-04 17:20, if the reply is a couple of days before</p></li>
</ul>

<p>I am maintaining the timestamp in a database as a <a href="http://en.wikipedia.org/wiki/Unix_time" rel="nofollow">Unix time</a>. For example my timestamp is 1265709142.</p>

<p>How can this be implemented with PHP?</p>
