<?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>Wed, 19 Jun 2013 07:42:49 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Leonid Mamchenkov' Blog: PHP date() and 53 weeks]]></title>
      <guid>http://www.phpdeveloper.org/news/14012</guid>
      <link>http://www.phpdeveloper.org/news/14012</link>
      <description><![CDATA[<p>
In doing some work with data and date ranges, <i>Leonid Mamchenkov</i> came across something strange about the "weeks" that the date and time functions in PHP work on. Sometimes, there's not always <a href="http://mamchenkov.net/wordpress/2010/02/10/php-date-and-53-weeks">52 weeks in a year</a>.
</p>
<blockquote>
<p>
With code as simple and straight-forward as [our example], you'd probably look for the problem elsewhere.  Maybe it's your statistical data which is wrong, or the graph is not generated properly.  But the problem is here.
</p>
<p>
How many weeks do you think there are in a year?  A common knowledge says 52.  However, if you think for a moment about how the weeks are related to the year, you'll realize that the first and last weeks don't necessary start and end at the edge of the year. 
</p>
</blockquote>
<p>
So, when using the <a href="http://php.net/date">date</a> function, you might not get quite what you were expecting. It works more correctly and can include the extra "week" if there's enough of an overlap. The "W" parameter (for "week") works off of the <a href="http://en.wikipedia.org/wiki/ISO_week_date">ISO-8601 week number</a> for the year, not the general calendar weeks.
</p>]]></description>
      <pubDate>Thu, 11 Feb 2010 12:12:09 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Calculating start and end dates of a week]]></title>
      <guid>http://www.phpdeveloper.org/news/6207</guid>
      <link>http://www.phpdeveloper.org/news/6207</link>
      <description><![CDATA[<p>
With just a quick handy code snippet posted on his blog today, <i>Derick Rethans</i> shares <a href="http://derickrethans.nl/calculating_start_and_end_dates_of_a_week.php">these two lines</a> to help grab the start and end dates of a week in question.
</p>
<blockquote>
A friend asked "How do I calculate start (monday) and end (sunday) dates from a given week number for a specified year?" Instead of having to come up with your own algorithm you can simply do the following in PHP 5.1 and higher.
</blockquote>
<p>
The code makes use of the ISO8601 datetime functionality to grab the correct value from a strtotime command. <i>Derick</i> also <a href="http://derickrethans.nl/calculating_start_and_end_dates_of_a_week.php">briefly explains</a> how it all works.
</p>
]]></description>
      <pubDate>Wed, 06 Sep 2006 07:03:24 -0500</pubDate>
    </item>
  </channel>
</rss>
