|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-03-30 15:27 UTC] derick@php.net
-Status: Open
+Status: Bogus
[2010-03-30 15:27 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
Description: ------------ On March 30th and 31th the date function does not work correctly. If you work with date("m")-1 the result is not 02 for the month. You get 03 for the month but 02 for the day!! If you change the system clock to another date the funtion works correctly. See code below. If you set the clock to Apr 30th and use date('m')-2 you get the same wrong result. Test script: --------------- echo "<br>today: ". $today = mktime(0, 0, 0, date("m") , date("d"), date("Y")); echo "<br>". date('d.m.Y', $today); echo "<br>"; echo "<br>tomorrow: ". $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); echo "<br>". date('d.m.Y', $tomorrow); echo "<br>"; echo "<br>last1month: ". $lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); echo "<br>". date('d.m.Y', $lastmonth); echo "<br>"; echo "<br>last2month: ". $lastmonth = mktime(0, 0, 0, date("m")-2, date("d"), date("Y")); echo "<br>". date('d.m.Y', $lastmonth); echo "<br>"; echo "<br>last3month: ". $lastmonth = mktime(0, 0, 0, date("m")-3, date("d"), date("Y")); echo "<br>". date('d.m.Y', $lastmonth); echo "<br>"; Expected result: ---------------- 30.02.2010 Actual result: -------------- 02.03.2010