cvs: php4 /pear/Date Calc.php

From: Date: Thu, 13 Jun 2002 22:09:46 +0000
Subject: cvs: php4 /pear/Date Calc.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4605@lists.php.net to get a copy of this message
pajoye Thu Jun 13 18:09:46 2002 EDT Modified files: /php4/pear/Date Calc.php Log: Fix isValid method : wrong order for the params to checkdate() Index: php4/pear/Date/Calc.php diff -u php4/pear/Date/Calc.php:1.22 php4/pear/Date/Calc.php:1.23 --- php4/pear/Date/Calc.php:1.22 Tue Jun 11 11:14:51 2002 +++ php4/pear/Date/Calc.php Thu Jun 13 18:09:45 2002 @@ -64,7 +64,7 @@ { if($year < 0 || $year > 9999) return false; - if(!checkdate($day,$month,$year)) + if(!checkdate($month,$day,$year)) return false; return true; @@ -1206,7 +1206,7 @@ function daysToDate($days,$format="%Y%m%d") { - $days -= 1721119; + $days -= 1721119; $century = floor(( 4 * $days - 1) / 146097); $days = floor(4 * $days - 1 - 146097 * $century); $day = floor($days / 4); @@ -1233,7 +1233,6 @@ $century = sprintf("%02d",$century); $year = sprintf("%02d",$year); - return(Date_Calc::dateFormat($day,$month,$century.$year,$format)); } // end func daysToDate

« previous php.pear.cvs (#4605) next »