Jump to content

DST problem in Brazil


georgewr3

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.