Zend Date — day difference

前端 未结 6 1504
温柔的废话
温柔的废话 2020-12-17 20:51

I have the below line of codes

$day1 = new Zend_Date(\'2010-03-01\', \'YYYY-mm-dd\');
$day2 = new Zend_Date(\'2010-03-05\', \'YYYY-mm-dd\');
$dateDiff = $da         


        
6条回答
  •  感动是毒
    2020-12-17 21:21

    I believe the problem is in your part string. Try YYYY-MM-dd instead.

    $day1 = new Zend_Date('2010-02-28', 'YYYY-MM-dd');
    $day2 = new Zend_Date('2010-03-01', 'YYYY-MM-dd');
    echo $day2->sub($day1)->toString(Zend_Date::DAY);
    

提交回复
热议问题