php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64332 Problems with BR Save time (BRST)
Submitted: 2013-03-01 17:59 UTC Modified: 2013-09-22 22:33 UTC
From: bernardo at datamex dot com dot br Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Window,Linux,FreeBSD
Private report: No CVE-ID: None
 [2013-03-01 17:59 UTC] bernardo at datamex dot com dot br
Description:
------------
I changed my server application before Freebsd with php 5.3.3 now Ubuntu with php 
5.3.10.
I noticed that there are differences between treatment dates in different 
timezones.

Note that when BRST "America/Sao_Paulo" advances one hour.

Test script:
---------------
<?php

error_reporting(E_ALL);

$timezone = date_default_timezone_get();
$time = mktime(12,0,0,1,15,2013);

$agoraAqui = date("d/m/Y H:i:s");
$antesAqui = date("d/m/Y H:i:s", $time);

date_default_timezone_set('America/Bahia');
$agoraLa = date("d/m/Y H:i:s");
$antesLa = date("d/m/Y H:i:s", $time);


echo "<table border=1>
	<tr>
		<td></td><td>NOW</td><td>In BRST ({$time})</td>
	</tr>
	<tr>
		<td>{$timezone}</td><td>{$agoraAqui}</td><td>{$antesAqui}</td>
	</tr>
	<tr>
		<td>America/Bahia</td><td>{$agoraLa}</td><td>{$antesLa}</td>
	</tr>
</table>
<br />
<a href='http://wwp.greenwichmeantime.com/time-zone/south-america/brazil/time-brazil/'>time-brazil</a>
";
?>

Expected result:
----------------
NOW | In BRST (1358258400)
America/Sao_Paulo | 01/03/2013 14:46:27 | 15/01/2013 12:00:00
America/Bahia | 01/03/2013 14:46:27 | 15/01/2013 11:00:00


Actual result:
--------------
Correct in:
- freebsd + php 5.3.3
- freebsd + php 5.3.6
- windows + php 5.3.8

NOW | In BRST (1358258400)
America/Sao_Paulo | 01/03/2013 14:46:27 | 15/01/2013 12:00:00
America/Bahia | 01/03/2013 14:46:27 | 15/01/2013 11:00:00

Error in:
- freebsd + php 5.3.10
- ubuntu + php 5.3.10
- windows + php 5.4.3

NOW | In BRST (1358258400)
America/Sao_Paulo | 01/03/2013 14:46:27 | 15/01/2013 12:00:00
America/Bahia | 01/03/2013 14:46:27 | 15/01/2013 12:00:00


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-18 22:37 UTC] cmbecker69 at gmx dot de
If I'm not mistaken the "actual results" are correct, and the 
"expected results" are wrong.  At least according to Wikipedia[1] 
America/Sao_Paulo and America/Bahia have the same offset to UTC
and identical DST offset.

If so, this is not a bug (but rather an older bug was fixed).

[1] <http://en.wikipedia.org/wiki/Bras%C3%ADlia_Summer_Time>
 [2013-09-19 01:57 UTC] bernardo at datamex dot com dot br
Please read this part "Does Brazil observe Daylight Saving Time?" in link 
http://wwp.greenwichmeantime.com/time-zone/south-america/brazil/time-brazil/

Brazil Decree No. 7826 of 15 October.2012.
Gives new wording of art. 2 of  Decree No. 6558 of 08 September 2008 
establishing daylight saving time in part of the national territory. Daylight 
saving time will be valid in the states of Rio Grande do Sul, Santa Catarina, 
Parana, Sao Paulo, Rio de Janeiro, Espirito Santo, Minas Gerais, Goiás, Mato 
Grosso, Mato Grosso do Sul, Tocatins and the Federal District.
 [2013-09-22 22:33 UTC] aharvey@php.net
-Status: Open +Status: Not a bug
 [2013-09-22 22:33 UTC] aharvey@php.net
PHP uses the Olson time zone database. Older versions of PHP have older versions 
of the database bundled, and can be updated using the PECL timezonedb package.

It appears that the bundled time zone database is correct in newer versions of 
PHP: http://3v4l.org/a1i0h suggests that the relevant fixes went into PHP 5.3.19, 
5.4.9 and 5.5.0.

Closing, since this is fixed in current versions.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 09:01:32 2024 UTC