Re: DAte use in For loop

Поиск
Список
Период
Сортировка
От Jean-Michel Chabanne
Тема Re: DAte use in For loop
Дата
Msg-id b8rv1j$2vnp$1@news.hub.org
обсуждение исходный текст
Ответ на DAte use in For loop  ("Ramesh PAtel " <ramesh@banas.guj.nic.in>)
Список pgsql-admin
Ramesh PAtel wrote:
> Hi All
>
> please give one  help
>
> I want to us date variable in for loop Condition. in PHP
>
> But it not working Properly.
> $dt='2003-04-22' ;
> $to='2003-04-30';
>
> FOR ( $dt=$dt; $dt > $to ;  )
> {
> print "XYz";
> }
>
> Please Help me
>
> and how to file date diff in Day please Help
>
> Ramesh Patel
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



$begin_d = mktime(2, 0, 0, 4, 22, 2003);
$end_d = mktime(2, 0, 0, 4, 30, 2003);

while($begin_d <= $end_d)
{
    echo date("Y-m-d",$begin_d) . "\n";
    $begin_d += 86400;
}

For PHP informations, look at comp.lang.php


--
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux


В списке pgsql-admin по дате отправления:

Предыдущее
От: "Vinay"
Дата:
Сообщение: Newbie
Следующее
От: Tim Ellis
Дата:
Сообщение: Re: Newbie