Forum Moderators: coopster

Message Too Old, No Replies

PHP 5.2+ / timezone Database / daylight saving adjustments

PHP 5.2+ timezones daylight saving adjustments

         

scandiman

7:10 am on Mar 2, 2007 (gmt 0)

10+ Year Member



I want to build a multiple timezone current time display script but I want to make the right assumptions before I begin. I've been searching the web for this info to no avail and I'm hoping someone here has some insights.

I'm trying to find out if the included timezone database for PHP 5.2.0 has daylight saving offsets built in and if so, what is it based on and how often is it updated?

My servers Timezone Database Version is 2006.14 but according to pecl.php.net the most current version is 2007.2. How can I find out what changed between these versions?

Any help is appreciated.

jatar_k

3:43 pm on Mar 2, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld scandiman,

from
[pecl.php.net...]

This extension is a drop-in replacement for the builtin timezone database that comes with PHP. You should only install this extension in case you need to get a later version of the timezone database than the one that ships with PHP.

in the changelog for PHP 5.2.1 [php.net] it says

Updated timezone database to version 2006.16. (Derick)

so the one in php is newer than yours and as stated in the pecl link you can drop in the newer one if needed. I can't seem to find any real mention of what changed between them.

there is an example of how to check your server timezone settings by parsing phpinfo here
[php.net...]

an interesting story from Zend
TLK: The date wars [zend.com]

extra info
[en.wikipedia.org...]

scandiman

6:14 pm on Mar 2, 2007 (gmt 0)

10+ Year Member



Thanks for the welcome. I've been lurking for quite some time but finally had a need to post.

so the one in php is newer than yours and as stated in the pecl link you can drop in the newer one if needed. I can't seem to find any real mention of what changed between them.

Yea, I can't find anything either. I wonder if it is just about the annual Brazil DST update, the US changes or something more. Would be a good thing to be noted with the update. I hate making these kinds of assumptions about something so fundamental.

an interesting story from Zend TLK: the date wars [zend.com]

That was a great read. Thanks for pointing it out. This is the first place I found that indicated that the PHP timezone DB is based on the Olson TZ database. This implies that daylight saving time is built in but I can't find it stated anywhere. Do you know of any other PHP specific discussions related to timezones and DST? Funny how something we take for granted every day is actually very complicated.

Anyone else have any input on this issue?

jatar_k

6:18 pm on Mar 2, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



all of those links came from these searches

Timezone Database Version [google.com]

Timezone Database Version changes [google.com]

Timezone Database Version changes php [google.com]

there may be some other points of interest in there, I can just can't post the links here ;)

scandiman

11:07 pm on Mar 2, 2007 (gmt 0)

10+ Year Member



OK, so I've decided to try and test this out on my local dev environment which is MAMP but I need to upgrade the timezonedb file to the latest version 2007.2.

To quote the official description from the pecl site [pecl.php.net],

"This extension is a drop-in replacement for the builtin timezone database that comes with PHP. You should only install this extension in case you need to get a later version of the timezone database than the one that ships with PHP." (emphasis added)

I can't figure out where to "drop-in" the file(s), I have a feeling my version of "drop-in" as a Mac user is seriously different from what "drop-in" means to the author of this db update description.

Can anyone set me straight on what to do? (pls, no mac bashing) I've googled to no avail. Any help appreciated. :)

jatar_k

4:06 pm on Mar 7, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



did you figure anything out?

sorry, I was away, not really sure where to go from here

anyone else?

scandiman

5:48 am on Mar 8, 2007 (gmt 0)

10+ Year Member



Nothing yet. I have e-mailed the lead timezonedb maintainer, hopefully they can point me in the right direction. I will post a solution when discovered for the benefit of everyone.

Still, any input is appreciated.