really need some more information about time...

From: Date: Mon, 04 Dec 2000 21:20:23 +0000
Subject: really need some more information about time...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28637@lists.php.net to get a copy of this message
ok, I know Ive asked this before, but well, I dont know, I just can`t get it right. When I know the year and the week and I need to get all the dates in that week, how could I get them? I`ve tried something with the following code(which doesn`t work actually, as sometimes it says the first day of the year is the 4th or whatever...). Well, the code is here, I`d appreciate any help you can provide. <?php $week = 1; $year=2000; $thething=$year."-01-01"; $temp = mktime(0,0,0,1,0,$year); $aeg = date("w",mktime(0,0,0,1,1,$year)); $something="algus"; $x=$week; $c=0; if($something == "algus"){ for($w=1;$w<=$x;$w++){ for($d=$aeg;$d<=6;$d++){ $c++; } $something = "lőpp"; break; } } if($something=="lőpp" AND $x > 1){ for($w=2;$w<=$x;$w++){ for($d=0;$d<=6;$d++){ $c++; } } } $b = $c*24*60*60+$temp; echo $g = date("j",$b); ?> Thanks Siim ...

« previous php.general (#28637) next »