note 45849 added to function.date
| From: | tmorin at cea dot fr | Date: | Tue, 21 Sep 2004 17:04:27 +0000 |
| Subject: | note 45849 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77111@lists.php.net to get a copy of this message | ||
This code gives you the dates of a particular week
Example : week 39 (2004)
$arr_date['Mon']='2004-09-20';
$arr_date['Tue']='2004-09-21';
$arr_date['Wed']='2004-09-22';
$arr_date['Thu']='2004-09-23';
$arr_date['Fri']='2004-09-24';
$arr_date['Sat']='2004-09-25';
$arr_date['Sun']='2004-09-26';
//Here is the code
function date_of_week($week)
{
$dec=0;
while($numerosemaine<=$week)
{
$numerosemaine=date( "W",mktime(
0,0,0,"01","01"+$dec,date("Y")) );
if($numerosemaine==$week)
{
$dateEnChiffre=date( "Y-m-d",mktime(
0,0,0,"01","01"+$dec,date("Y")));
$dateEnJourGB=date( "D",mktime(
0,0,0,"01","01"+$dec,date("Y")));
$arr_date[$dateEnJourGB]=$dateEnChiffre;
}
$dec++;
}
return $arr_date;
}
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45849
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45849&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45849&report=yes
Search -- http://master.php.net/manage/user-notes.php