0

I used the below code for finding the difference in days for two dates :

   1 $startDate = new Zend_Date('2010-02-28', 'YYYY-MM-dd');
   2 $lastDate  = new Zend_Date('2010-03-01', 'YYYY-MM-dd');
   3 $diff = $lastDate->sub($startDate)->toValue();
   4 $days = ceil($diff/60/60/24) +1;

The 3rd line in php shows me an error :

Expected an operand but found Refs:Zend Date -- day difference

Community
  • 1
  • 1
MoopanMec
  • 47
  • 2
  • 7

1 Answers1

1

Use in 3rd line

$diff = $lastDate->sub($startDate)->toString(Zend_Date::DAY);

that solve your problem.