faqts : Computers : Programming : Languages : PHP : Function Libraries : Date and Time

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 2 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

How can I find the date of every Tuesday from now through the next year?

Jul 31st, 2006 00:55
Herman Cheah, Chris Meyer, http://www.go-2.net


//$intDayofYear = Integer value of how many days of the year
    $intDayOfYear = 365;
   $intYearEnd = 2008;
     $now = time();
    
    for($count=0;($count<=$intDayOfYear);$count++)
	{
	 // Plus 1 day to the current day
	 $now += 60*60*(24);	
	 if((date('D', $now) == 'Tue')&&(date('Y',$now)!=$intYearEnd))
	 {
	  echo date("D m/d/Y", $now)."<BR>";
	}		
    }