<?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>Thu, 20 Jun 2013 05:33:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Moon's Blog: Errors when adding/subtracing dates using seconds]]></title>
      <guid>http://www.phpdeveloper.org/news/17406</guid>
      <link>http://www.phpdeveloper.org/news/17406</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has <a href="http://brian.moonspot.net/errors-adding-subtracting-dates">a reminder about date handling</a> in PHP - days are not always 86400 seconds long, sometimes there's "leap seconds" included too. Thankfully, there's easy ways around it:
</p>
<blockquote>
The problem with this is that it assume that there are only 86400 seconds in every day. There are in fact not. On days when the clocks change for daylight savings time, there are either 1 hour more than that or 1 hour less than that. In addition, there are also <a href="http://en.wikipedia.org/wiki/Leap_second">leap seconds</a> put into our time system to keep us in line with the sun. There is one this year, 2012, on June 30th in fact. Since they don't happen with the regularity that daylight savings time does, it may be easy to forget those. Luckily, for this problem, the solution is the same.
</blockquote>
<p>
His first solution involves letting <a href="http://php.net/strtotime">strtotime</a> do the work for him, internally calculating the leap seconds or any other issue that might come up. As an alternate solution, he also mentions "doing your math at noon" - this gives you enough leeway to make the offset leap seconds could cause a much smaller risk.
</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 11:19:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[James Cohen's Blog: Working with Date and Time in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16292</guid>
      <link>http://www.phpdeveloper.org/news/16292</link>
      <description><![CDATA[<p>
<i>James Cohen</i> has <a href="http://webmonkeyuk.wordpress.com/2011/05/04/working-with-date-and-time-in-php/">a new post to his blog</a> today looking at some of the built-in functionality that PHP has to work with dates and times including simple things like <a href="http://php.net/strtotime">strtotime</a> and the <a href="http://php.net/datetime">DateTime</a> feature.
</p>
<blockquote>
A lot of people ask questions relating to date and time in PHP. Here are some answers to the most commonly asked questions and common mistakes.
</blockquote>
<p>
He covers the differences between working with dates in strtotime, worrying about timezone settings and compares the strtotime/DateTime methods for formatting and returning dates, modifying dates, converting between timezones as well as finding the difference between two timezones. 
</p>]]></description>
      <pubDate>Wed, 04 May 2011 08:59:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Enavu.com: PHP Smart Date Parsing: Natural Language Input (task.fm explained)]]></title>
      <guid>http://www.phpdeveloper.org/news/14448</guid>
      <link>http://www.phpdeveloper.org/news/14448</link>
      <description><![CDATA[<p>
On the Enavu.com blog today there's a new tutorial talking about <a href="http://web.enavu.com/snippets/php-smart-date-parsing-natural-language-input-task-fm-explained/">smart date parsing</a> using just the normal natural language you use every day.
</p>
<blockquote>
Have you ever tried task.fm ? task.fm uses something called "Natural Language Input," and it's very interesting. To put it simply, you enter a natural language input such as, "Pick up my kids from school tomorrow 3pm" or "Pool party this Saturday at 4pm."
</blockquote>
<p>
They suggest using the <a href="http://php.net/manual/en/function.strtotime.php">strtotime</a> function to handle some of the difficult work. There's a snippet of code included showing it in use and an explanation of how the function would handle the parts of the sentence "I am going to go to the beach at 3pm tomorrow".
</p>]]></description>
      <pubDate>Mon, 03 May 2010 10:06:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Calculating Daylight Savings Time Boundary In PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12115</guid>
      <link>http://www.phpdeveloper.org/news/12115</link>
      <description><![CDATA[<p>
<i>Daniel Cousineau</i> has written up some timely advice in <a href="http://www.toosweettobesour.com/2009/03/10/calculating-daylight-savings-time-boundary-in-php/">a new post</a> to his blog. It looks at pinpointing the time boundary for Daylight Savings Time in a PHP script (when it starts and when it ends).
</p>
<blockquote>
I had an issue recently where I needed to calculate the Unix timestamp for the daylight savings time boundaries. According to the <a href="http://aa.usno.navy.mil/faq/docs/daylight_time.php">United States Naval Observatory</a>, daylight savings time begins the Second Sunday of March and ends on the First Sunday of November.
</blockquote>
<p>
He looks at using the <a href="http://php.net/strtotime">strtotime</a> function to calculate these dates but points out some quirks - like what happens when you just give it a month or something like "second Sunday". His solution was to go back one day ("March 0" instead of "March 1") and calculating the time from there, including that first full day of March in the calculation.
</p>]]></description>
      <pubDate>Wed, 11 Mar 2009 12:02:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Calculating start and end dates of a week]]></title>
      <guid>http://www.phpdeveloper.org/news/6724</guid>
      <link>http://www.phpdeveloper.org/news/6724</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has posted a <a href="http://derickrethans.nl/calculating_start_and_end_dates_of_a_week.php">quick tip</a> to his blog today:
</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>
<a href="http://derickrethans.nl/calculating_start_and_end_dates_of_a_week.php">The (technically) three-line code</a> uses ISO format for the date to tell you which day is the starting day of that week and which is the end. He only explains this format just a bit, so if you want more information, check out the <a href="http://us2.php.net/manual/en/function.strtotime.php">strtotime</a> function page.
</p>]]></description>
      <pubDate>Thu, 16 Nov 2006 15:13:37 -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>
    <item>
      <title><![CDATA[Dallas PHP Users Group: PHP4 to PHP5 Minor gotcha]]></title>
      <guid>http://www.phpdeveloper.org/news/4652</guid>
      <link>http://www.phpdeveloper.org/news/4652</link>
      <description><![CDATA[On the Dallas PHP Users Group website today, there's <a href="http://dallasphp.org/?q=node/105">quick little "gotcha"</a> by <i>MonkeyT</i> when it comes to using the strtotime() function.
<p>
<quote>
<i>
strtotime translates a date presented in various formats into a unix timestamp. It allows the syntax "+2 weeks" and various other time units to push that chosen date translation into the future. In 4.3.10, php would allow a space between the + and the beginning of the parameter. that doesn't seem to be the case any more. ("+3 days", not "+ 3 days"). Other than that, pretty smooth changeover so far.
</i>
</quote>
<p>
It's pretty subtle, but I could potentially cause some headaches in the future - so keep an eye out!]]></description>
      <pubDate>Thu, 12 Jan 2006 06:58:21 -0600</pubDate>
    </item>
  </channel>
</rss>
