On 12/29/2011 01:22 PM, Eric Lommatsch wrote:
Hello List,
I am using PHP version 5.2.6.
I am using PHP V5.3.3
In my setup, the following lines give me errors stating that PHP cannot
convert the DateTime object to a string. I was able to get around the
error by changing your code to the following.
$intDayCnt=$dteEndDate[$i]-$dteStartDate[$i];
$intDayCnt = ( $dteEndDate[$i]->format('m') -
$dteStartDate[$i]->format('m') );
Be sure to change the following line as well.
$dteCheckDate = date('U');
if (($dteCheckDate>=($dteEndDate[$i]-7)&&
$dteCheckDate<=($dteEndDate[$i]+1))&& $intDayCnt<16)
if (
$dteCheckDate >= ( $dteEndDate[$i]->format('U') - (7*86400) )
&&
$dteCheckDate <= ( $dteEndDate[$i]->format('U') + (86400) )
&&
$intDayCnt < 16
) {
Eric Lommatsch.
--
Jim Lucas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php