|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-09-18 22:37 UTC] cmbecker69 at gmx dot de
[2013-09-19 01:57 UTC] bernardo at datamex dot com dot br
[2013-09-22 22:33 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2013-09-22 22:33 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 08:00:01 2025 UTC |
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