<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 26 May 2013 02:19:59 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Printing relative dates in php]]></title>
      <guid>http://www.phpdeveloper.org/news/14683</guid>
      <link>http://www.phpdeveloper.org/news/14683</link>
      <description><![CDATA[<p>
<i>Sameer Borate</i> has a <a href="http://www.codediesel.com/php/printing-relative-dates-in-php">quick, helpful tip</a> for anyone working with dates in PHP and wanting something a bit more readable than just the standard month-day-year kind of format.
</p>
<blockquote>
A couple of days back while writing some date code for a messaging service, I required to print the date of the messages in a relative format - 'today', 'yesterday', '3 weeks ago' etc. I wrote a small function for the same.
</blockquote>
<p>
The technique uses a "DateToWords" function he's created that finds the difference between now and the date being searched for and evaluates it to see how many days and weeks it might be offset from that day. The code for the function is included. 
</p>]]></description>
      <pubDate>Tue, 22 Jun 2010 10:52:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: Give Your Visitors a Relative Time]]></title>
      <guid>http://www.phpdeveloper.org/news/9759</guid>
      <link>http://www.phpdeveloper.org/news/9759</link>
      <description><![CDATA[<p>
Following on the heels of <A href="http://www.phpdeveloper.org/news/9744">this post</a> to the SitePoint blog (about "roughtime"), <i>Akash Mehta</i> has posted <a href="http://www.developertutorials.com/blog/php/give-your-visitors-relative-time-php-69/">his own version</a> of providing users with something a little different - relative time.
</p>
<blockquote>
I understood the merits of the approach, but it struck me that a relative time might be a little more useful for many situations. For example, in a fast moving discussion, a short timestamp (e.g. 8:30 AM) as well as a verbal summary of how long ago the time was (e.g. "4 hours ago", "20 minutes ago") are most useful to the user. [...] Now, I figured this could be achieved very easily in PHP - and it could.
</blockquote>
<p>
His code <a href="http://www.developertutorials.com/blog/php/give-your-visitors-relative-time-php-69/">is included</a> showing a series of if/else comparisons that change the values to their hour/minute/second counterparts. He also recommends the <a href="http://pear.php.net/package-info.php?package=Numbers_Words">PEAR Numbers_Words package to help with readability.
</p>]]></description>
      <pubDate>Fri, 07 Mar 2008 11:19:00 -0600</pubDate>
    </item>
  </channel>
</rss>
