Afficher un message
Vieux 14/09/2007, 20h22   #1
cla
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Slow performance using strtotime on prior 1970 dates

I'm using this code on an application to track football schedules:
----
$season = '2005';
$basedate = strtotime('this friday', strtotime('31 August '.$season));

for($d=0;$d<=31;$d++) {
$d2=strtotime("+".$d." day",$basedate);
echo(date('m d Y',$d2)."\n");
}
----
The purpose is to find the first Friday on or after Aug. 31 in a given
year. Plug '2005' into $season, and it flies through. Plug in
'1905', however, and each step in the for loop takes about .5 sec.
I'm running this code in PHP 5.2.1. Any ideas?

  Réponse avec citation
 
Page generated in 0,04586 seconds with 9 queries