<?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>Fri, 24 May 2013 05:15:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Federico Cargnelutti's Blog: Format a time interval with the requested granularity]]></title>
      <guid>http://www.phpdeveloper.org/news/12756</guid>
      <link>http://www.phpdeveloper.org/news/12756</link>
      <description><![CDATA[<p>
<i>Federico Cargnelutti</i> has <a href="http://blog.fedecarg.com/2009/06/25/format-a-time-interval-with-the-requested-granularity/">posted a class</a> (DateIntervalFormat) that gives you the difference between a date and "now" in words rather than an integer.
</p>
<blockquote>
This class, a refactored version of Drupal's format_interval function, makes it relatively easy to format an interval value. The format will automatically format as compactly as possible. For example: if the difference between the two dates is only a few hours and both dates occur on the same day, the year, month, and day parts of the date will be omitted.
</blockquote>
<p>
So, instead of getting a value of "86400 seconds" you'd get back something like "5 days 3 hours".
</p>]]></description>
      <pubDate>Thu, 25 Jun 2009 12:56:51 -0500</pubDate>
    </item>
  </channel>
</rss>
