note 31124 deleted from function.strftime by derick
| From: | derick@php.net | Date: | Sun, 14 Aug 2005 12:03:46 +0000 |
| Subject: | note 31124 deleted from function.strftime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93625@lists.php.net to get a copy of this message | ||
Note Submitter: luismorales at juntos dot com
----
The next script print the week and day begin and end of the week
<?
$duracion = 12;
$dia = '05';
$mes = '03';
$anio = '2003';
$fecha_inicio = mktime(0,0,0,$mes,$dia,$anio);
$semana_inicio = strftime("%W", mktime(0,0,0,$mes,$dia,$anio));
$dia_semana_inicio =strftime("%u", mktime(0,0,0,$mes,$dia,$anio));
echo "Fecha Inicio :: {$dia}/{$mes}/{$anio}<br>";
echo "semana :: {$semana_inicio} <br>";
echo "Dia Semana Inicio :: {$dia_semana_inicio} <br>";
$x_ini = ($dia_semana_inicio > 1) ? ($fecha_inicio - ($dia_semana_inicio-1)* 86400) :
($fecha_inicio) ;
for($i=0;$i<=$duracion;$i++){
$y_ini = (int) $x_ini + ($i*7*86400);
$y_fin = (int) $x_fin + ($i*7*86400);
echo "Semana :: ".strftime("%V", mktime(0,0,0,date("m", $y_ini),
date("d", $y_ini), date("Y", $y_ini) )) . " :: [ " .
date("d-m-Y", $y_ini) ."/" .date("d-m-Y", $y_fin)."
]<br>";
}
?>