note 52084 added to function.mktime
| From: | armando at scribano dot com dot ar | Date: | Wed, 20 Apr 2005 21:12:33 +0000 |
| Subject: | note 52084 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88293@lists.php.net to get a copy of this message | ||
This function return date (format d/m/Y) of N monday
$fechalunes1 = buscalunes($lunes='1');
function buscalunes($lunes)
{
//busca N lunes y da el dia
$fecha = date ("Ymd");
$ano = substr ($fecha,0, 4);
$mes = substr ($fecha,4, -2);
$dia = substr ($fecha,6,8);
$con=1;
while($contlunes!=$lunes)
{
$dia_chr = date( "l", mktime(0,0,0,$mes,$dia-$con,$ano));
if($dia_chr=='Monday')
{
$fechalunes = date( "d/m/Y", mktime(0,0,0,$mes,$dia-$con,$ano));
$contlunes++;
}
$con ++;
}
return $fechalunes ;
}
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52084
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52084&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52084&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52084&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52084&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52084&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52084&report=yes
Search -- http://master.php.net/manage/user-notes.php