Hey!, thx I use the Zend_Date::addHour method, but is your wolution works fine
too, here's my code:
$objDateStartMin = new Zend_Date( "2008-08-12 00:00:00", null,
Zend_Registry::get( "objLocale" ) );
// Get date_end_max Zend_Date object.
$objDateEndMax = new Zend_Date( "2008-09-26 00:00:00", null,
Zend_Registry::get( "objLocale" ) );
while ( $objDateEndMax->isLater( $objDateStartMin ) )
{
$objDateNextDay = $objDateStartMin->addHour( 24 );
echo "next day: " . $objDateNextDay->toString();
}
----- Original Message -----
From: "Vladas Diržys" <[EMAIL PROTECTED]>
To: "Juan Felipe Alvarez Saldarriaga" <[EMAIL PROTECTED]>
Cc: "fw-general" <[email protected]>
Sent: Thursday, August 21, 2008 3:45:50 PM GMT -05:00 Columbia
Subject: Re: [fw-general] How to generate a range of dates using Zend_Date?
Hello,
so far I can remember Zend_Date has a method addDay().
And the solution would look like:
$dateFrom = new Zend_Date('2008-08-12 00:00:00');
$dateTo = new Zend_Date('2008-09-26 00:00:00');
while ($dateFrom->compareDate($dateTo)) {
echo $dateFrom->toString();
$dateFrom->addDay(1);
}
or somthing like that ;-)
--
Pagarbiai,
Vladas Diržys
Tel.: +370 620 69020
www.dirzys.com
On Thu, Aug 21, 2008 at 10:54 PM, Juan Felipe Alvarez Saldarriaga <
[EMAIL PROTECTED]> wrote:
> Hey! :)
>
> I have a question, how to generate a range of dates using Zend_Date? I
> mean, if I have this range of dates from the database: 2008-08-12 00:00:00 |
> 2008-09-26 00:00:00 and I want to get all dates between those dates, like:
>
>
> 2008-08-12
> 2008-08-13
> 2008-08-14
> 2008-08-15
> 2008-08-XX
> ...
> 2008-09-01
> 2008-09-02
> 2008-09-03
> 2008-09-XX
> ...
> 2008-09-26 00:00:00
>
> Thx for any help.
>