georgewr3 Posted October 4, 2007 Share Posted October 4, 2007 I'm trying to get DST for East Brazil working correctly with SuSe 10.2, PHP 5.2 and PostGreSQL 8.1.5. Apparently a change was made very recently in Brazil to move the beginning of DST there from 10/20-10/21 to 10/13-10/14. (They switch right at midnight to 1am in the fall, and 11pm in the spring - opposite of the U.S.) I have updated the timezone files via the zic command and placed the files at /usr/share/zoneinfo and /usr/share/postgresql/timezone. When I run a PostGreSQL shell and execute selects, the DST does occur at 10/13-10/14. Before I updated the timezone files, the queries showed the DST change at 10/20-10/21 which was correct up until the recent change in Brazilian DST. I got the newest timezone files from ftp://elsie.nci.nih.gov/pub/tzdata2007h.tar.gz which has the lastest Brazilian change. I updated the timezone files and got the following after the update: Output of the zdump command shows: # /usr/sbin/zdump -v -c 2008 Brazil/East | grep -w 2007 Brazil/East Sun Feb 25 01:59:59 2007 UTC = Sat Feb 24 23:59:59 2007 BRST isdst=1 gmtoff=-7200 Brazil/East Sun Feb 25 02:00:00 2007 UTC = Sat Feb 24 23:00:00 2007 BRT isdst=0 gmtoff=-10800 Brazil/East Sun Oct 14 02:59:59 2007 UTC = Sat Oct 13 23:59:59 2007 BRT isdst=0 gmtoff=-10800 Brazil/East Sun Oct 14 03:00:00 2007 UTC = Sun Oct 14 01:00:00 2007 BRST isdst=1 gmtoff=-7200 As shown in the last two lines, the DST timezone is correct. However when using PHP's date function (which defers to O/S as I understand it) it shows the DST change at Nov. 4th rather than 10/14. I have YAST set to Brazil East. (ex: $when_start = date("Y-m-d H:i:s O", $date); //where $date == '2007-11-04' ) It returns 2007-11-04 01:00:00 -0200 in $when_start which clearly shows the wrong hour and wrong time zone value (should be 2007-11-04 00:00:00 -0300 ) Is there a PHP patch or newer version that I need to get? Thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/71815-dst-problem-in-brazil/ Share on other sites More sharing options...
georgewr3 Posted October 4, 2007 Author Share Posted October 4, 2007 Well, I found this: http://derickrethans.nl/the_y2k7_problem.php However it doesn't appear that the latest timezone rules are updated in this package. Does anyone know how to do it manually? Quote Link to comment https://forums.phpfreaks.com/topic/71815-dst-problem-in-brazil/#findComment-361752 Share on other sites More sharing options...
georgewr3 Posted October 4, 2007 Author Share Posted October 4, 2007 I am aparently supposed to install the timezonedb PECL package. I tried: pear install timezonedb pear pickle install timezonedb etc. How is this normally done? Quote Link to comment https://forums.phpfreaks.com/topic/71815-dst-problem-in-brazil/#findComment-361922 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.