Ok, I got it working with the following:

$currentDate->set(0, Zend_Date::SECOND);
$currentDate->set(0, Zend_Date::MINUTE);
$currentDate->set(0, Zend_Date::HOUR);
$date->set(0, Zend_Date::SECOND);
$date->set(0, Zend_Date::MINUTE);
$date->set(0, Zend_Date::HOUR);




debussy007 wrote:
> 
> Hi,
> 
> I tried the following:
> 
> $currentDate = new Zend_Date();
> $date = new Zend_Date('2009-04-19', 'yyyy-MM-dd');
> 
> echo $currentDate->get('yyyy-MM-dd');
> echo '<br>';
> echo $date->get('yyyy-MM-dd');
> echo '<br>';
> 
> echo $date->sub($currentDate)/60/60/24;
> 
> I get the following result:
> 2008-11-11
> 2009-04-19
> 158.14543981481 
> 
> Did I do something wrong ?
> 
> Thank you for your kind help!
> 
> 
> thomasW wrote:
>> 
>> $date1->sub($date2);
>> 
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>> 
>> ----- Original Message ----- 
>> From: "debussy007" <[EMAIL PROTECTED]>
>> To: <[email protected]>
>> Sent: Tuesday, November 11, 2008 3:12 PM
>> Subject: [fw-general] Get the interval in days of two dates
>> 
>> 
>>>
>>> Hi,
>>>
>>> I need to get the interval in days of two dates:
>>>
>>> $date = new Zend_Date($advert['expired_date'], 'yyyy-MM-dd HH:mm:ss');
>>> $currentDate = new Zend_Date();
>>>
>>> I can then display something like:
>>> Your advert will expire in x days.
>>>
>>> Can anyone help me with this ?
>>>
>>> Thank you for any kind help !
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/Get-the-interval-in-days-of-two-dates-tp20440319p20440319.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com. 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Get-the-interval-in-days-of-two-dates-tp20440319p20447431.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to