Hello
can anyone help me in sloving my problem, it is very urgent. I want the total no.of weeks in a month and there week start date and week end date. Here the month and year are dynamic, based on the month and year year the total no.of weeks along with week start date and week end date for that particular month and year should be displayed.
Pls. try to solve this problem ASAP, it is very urgent.
I have tried to solve the problem finding the start date of the month and end date of the month but i am unable to proceed further, anyhow i am giving the way i have started here
// Determines Month Start Date
//$startofmonth = date ("Ymd", mktime (0,0,0,date("m"),1,date("Y")));
$startofmonth = mktime (0,0,0,date("m"),1,date("Y"));
// Determines Month End Date
$endofmmonth = date ("Ymd", mktime
(0,0,0,date("m"),date("t"),date("Y"))+1);
//Outputs Month Start Date - Month End Date
print "Start of Month : ".$startofmonth."<br>";
print "End of Month :".$endofmmonth."<br>";
After this I found the week day number of the first day of the month and found the first week start date and end date, I have used the following code to determine the first week start date and end date
I guess the "date("w",$startofmonth)" function is taking the return type of mktime function,
$weekdaynum = date("w",$startofmonth);
//print "First Week Day = ".$weekdaynum."<br>";
// Determines Week Start Date
$firstweekstartdate = date ("Ymd", mktime
(0,0,0,date("m",$startofmonth),date("d",$startofmonth)-$weekdaynum,date("Y",$startofmonth)));
// Determines Week End Date
$firstweekenddate = date ("Ymd", mktime
(0,0,0,date("m",$startofmonth),date("d",$startofmonth)+(6-$weekdaynum),date("Y",$startofmonth)));
//Outputs Week Start Date - Week End Date
print "First Week Start Date = ".$firstweekstartdate."<br>";
print "First Week End Date = ".$firstweekenddate."<br>";
pls. give the further solution and help in solving this problem
Thanks in advance.
Regards,
Hari.