<?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 01:13:48 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Derick Rethans' Blog: To GMT or not to GMT]]></title>
      <guid>http://www.phpdeveloper.org/news/17611</guid>
      <link>http://www.phpdeveloper.org/news/17611</link>
      <description><![CDATA[<p>
In <a href="http://derickrethans.nl/gmt-being-tricky.html">this new post</a> to his site, <i>Derick Rethans</i> shows an instance of "GMT being tricky" when it comes to "UTC" versus "GMT" output from PHP's DateTime object.
</p>
<blockquote>
Earlier today, on twitter, @skoop asked: "dear #lazyweb, when I use DateTimeZone('GMT'), why does format('e') output UTC?" [...] As you can see [the example with a format of "e" on a DateTimeZone('GMT')] has UTC and not GMT as you might expect.
</blockquote>
<p>
<i>Derick</i> mentions that sometimes, systems require "GMT" instead of "UTC" in the output they're given. To work around this issue, he shows how to add a "type 2" timezone to the DateTime object by including it when you initialize the object (code samples included). Using alternative methods, you can add these "type 2" timezones in three ways - an offset in the initial string, using the abbreviation (like "EST" or "PST") and specifying the long version of the timezone (like "America/Montreal").
</p>]]></description>
      <pubDate>Thu, 01 Mar 2012 11:39:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark Story's Blog: New errors in PHP 5.4]]></title>
      <guid>http://www.phpdeveloper.org/news/17324</guid>
      <link>http://www.phpdeveloper.org/news/17324</link>
      <description><![CDATA[<p>
In <a href="http://mark-story.com/posts/view/new-errors-in-php-5-4">this quick new post</a> to his blog <i>Mark Story</i> talks about two new errors he ran across when upgrading his installation to PHP 5.4, both showing up under E_ALL.
</p>
<blockquote>
I've been running the PHP5.4 RC builds for the last few months, and there are some interesting changes in the upcoming PHP release. On top of all the great new features coming in PHP5.4. After updating to PHP5.4-RC4, a few things that used to not trigger errors and silently do the wrong thing, now trigger notices or warnings.
</blockquote>
<p>
The two he mentions deal with a new warning on illegal string offsets and the other about string offsets ("Notice: String offset cast occurred"). You can find out about more changes in the PHP 5.4 series in <a href="http://php.net/releases/">the various Changelogs</a> for each Release Candidate and beta release.
</p>]]></description>
      <pubDate>Fri, 30 Dec 2011 08:30:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: How To Synchronize Your PHP and MySQL Timezones]]></title>
      <guid>http://www.phpdeveloper.org/news/16224</guid>
      <link>http://www.phpdeveloper.org/news/16224</link>
      <description><![CDATA[<p>
In a new post to the SitePoint PHP blog today <i>Craig Buckler</i> looks at a method for <a href="http://blogs.sitepoint.com/synchronize-php-mysql-timezone-configuration/">synchronizing your time between your PHP application and it's MySQL backend</a> to make date handling a bit easier - no messy code-based timezone changes needed.
</p>
<blockquote>
Many developers solve the problem by shifting all date/time responsibility to PHP. They may also convert dates to Unix timestamp integers for simpler handling, although you should be wary of the <a href="http://blogs.sitepoint.com/is-your-php-application-affected-by-the-y2k38-bug">Y2K38 Bug</a>.
</blockquote>
<p>
They show a handy tip so you won't have to worry quite so much that relies on setting a "TIMEZONE" constant you can use to <a href="http://php.net/date_default_timezone_set">set the default timezone</a> and a "time_zone" offset that can be used each time you make the connection to your database (or, alternatively, in a cron that keeps things up to date without interfering with performance).
</p>]]></description>
      <pubDate>Wed, 20 Apr 2011 11:52:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Storing Date/Times in Databases]]></title>
      <guid>http://www.phpdeveloper.org/news/14266</guid>
      <link>http://www.phpdeveloper.org/news/14266</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has a new post to his blog that helps to demystify some of the confusion around <a href="http://derickrethans.nl/storing-date-time-in-database.html">storing dates correctly</a> in your application's database. He mentions a suggested method of using the UTC time and offset together, but talks about why this isn't the best alternative.
</p>
<blockquote>
After my talk during <a href="http://confoo.ca/en">ConFoo</a> on <A href="http://confoo.ca/en/2010/session/advanced-date-time-handling-with-php">Advanced Date/Time Handling</a> I received a question about whether the UTC-offset, together with the date/time in years, months, days, hours, minutes and seconds, was enough for storing a date/time in a database and still being able to do calculations with this. The answer to this question was no, but it lead to an even more interesting discussion about what would be enough to store an accurate date/time in a database.
</blockquote>
<p>
He mentions the main issue with the UTC-offset method - time changes like Daylight Saving throwing a wrench into the works and how adding/subtracting hours doesn't always work as expected. His suggestion is to store the actual DateTime object information representing the location in question, the timezone identifier and the date/time information as strings. Then, when you need to calculate the date information on the other side, you can recreate it with a DateTime and DateTimeZone objects.
</p>]]></description>
      <pubDate>Tue, 30 Mar 2010 09:16:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Builder.com.au: Get the correct time by converting between time zones with PHP and PEAR]]></title>
      <guid>http://www.phpdeveloper.org/news/7336</guid>
      <link>http://www.phpdeveloper.org/news/7336</link>
      <description><![CDATA[<p>
On the Builder.com.au website today, there's <a href="http://www.builderau.com.au/program/php/soa/Get_the_correct_time_by_converting_between_time_zones_with_PHP_and_PEAR/0,339028448,339273806,00.htm?feed=rss">a quick new tutorial</a> on grabbing the correct time for a user's "home" rather than the server's time.
</p>
<blockquote>
PHP comes with an extensive catalog of date and time functions, all designed to let you easily retrieve temporal information, massage it into a format you require, and either use it in a calculation or display it to the user. However, if you'd like to do something more complicated, things get much, much hairier
</blockquote>
<p>
To make things easier, they enlist the service of the <a href="http://pear.php.net/package/Date">PEAR Date</a> package to help bridge the gap between the time zones faster. They give some of the basics of using the package before actually getting into the time zone conversion. The code is pretty straight-forward and they even include other simple tips like how to calculate the GMT offset and how to add and subtract timespans.
</p>]]></description>
      <pubDate>Fri, 23 Feb 2007 10:11:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Builder.com: Get the correct time by converting between time zones with PHP and PEAR]]></title>
      <guid>http://www.phpdeveloper.org/news/6465</guid>
      <link>http://www.phpdeveloper.org/news/6465</link>
      <description><![CDATA[<p>
On the Builder.com website, there's <a href="http://builder.com.com/5100-6371_14-6122735.html?part=rss&subj=bldr">a new tutorial</a> demonstrating how to use the PEAR Date class to make switching between time zones a snap.
</p>
<blockquote>
<p>
To be fair, PHP has built-in time zone functions to help with this, but these aren't particularly intuitive and require a fair amount of time to get used to. A quicker alternative is to use the <a href="http://pear.php.net">PEAR</a> Date class, which comes with built-in support for time zones and is, by far, the simplest way to perform these conversions.
</p>
<p>
This tutorial will teach you how to convert temporal values between time zones with the PEAR Date class. It assumes that you have a working Apache and PHP installation and that the PEAR Date class has been correctly installed.
</p>
</blockquote>
<p>
They <a href="http://builder.com.com/5100-6371_14-6122735.html?part=rss&subj=bldr">go with</a> a few simple examples to introduce you to how things work:
<ul>
<li>just taking in and echoing back out the date
<li>taking in the date and echoing it back out in a different format
<li>making a simple time zone conversion
<li>convert the timestamp to local time
<li>finding the offset for the time stamp from GMT
<li>adding and subtracting time stamps
</ul>
all complete with the (simple) code to perform them all.
</p>]]></description>
      <pubDate>Tue, 10 Oct 2006 09:38:00 -0500</pubDate>
    </item>
  </channel>
</rss>
