|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-02 04:46 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2010-04-02 04:46 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 08:00:01 2025 UTC |
Description: ------------ Hi all I must be missing the plot, I have just noticed that when accessing date information from a MYSQL DB, which has been stored in the format yyyy-mm-dd, the date is being displayed incorrectly as of 29/03/2010. Any date displayed using gmdate from and including 29/03/2010 and upto 04/04/2010, possibly further, is being displayed as the stored date LESS 1 day. Example DB table shows 2010-03-30 echo gmdate("d-m-Y", strtotime("$test1")); interpretates the same information as 29-03-2010. Am I missing the point or is there something wrong? Regards Ross Test script: --------------- <? $test26="2010-03-26"; $test27="2010-03-27"; $test28="2010-03-28"; $test29="2010-03-29"; $test30="2010-03-30"; $test31="2010-03-31"; $test32="2010-04-01"; $test33="2010-04-02"; echo gmdate("d-m-Y", strtotime("$test26"))," = $test26<br>"; echo gmdate("d-m-Y", strtotime("$test27"))," = $test27<br>"; echo gmdate("d-m-Y", strtotime("$test28"))," = $test28<br>"; echo gmdate("d-m-Y", strtotime("$test29"))," = $test29<br>"; echo gmdate("d-m-Y", strtotime("$test30"))," = $test30<br>"; echo gmdate("d-m-Y", strtotime("$test31"))," = $test31<br>"; echo gmdate("d-m-Y", strtotime("$test32"))," = $test32<br>"; echo gmdate("d-m-Y", strtotime("$test33"))," = $test33<br>"; ?> Expected result: ---------------- 26-03-2010 = 2010-03-26 27-03-2010 = 2010-03-27 28-03-2010 = 2010-03-28 29-03-2010 = 2010-03-29 30-03-2010 = 2010-03-30 31-03-2010 = 2010-03-31 01-03-2010 = 2010-04-01 02-04-2010 = 2010-04-02 Actual result: -------------- 26-03-2010 = 2010-03-26 27-03-2010 = 2010-03-27 28-03-2010 = 2010-03-28 28-03-2010 = 2010-03-29 29-03-2010 = 2010-03-30 30-03-2010 = 2010-03-31 31-03-2010 = 2010-04-01 01-04-2010 = 2010-04-02