FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How To Find All Weeks First date and Last date?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How To Find All Weeks First date and Last date? [message #174388 is a reply to message #174376] Thu, 09 June 2011 19:03 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 09-06-2011 14:25, Amit Pawar wrote:
> Hi,
>
> I want to find All no of week in any month.
> And first and last date of that week.
>
> Assume Month is Jan 2011
>
> date in Y-m-d
> 1st week -> Start date=2011-01-01 End date=2011-01-01
> 2nd week -> Start date=2011-01-02 End date=2011-01-08
> 3rd week -> Start date=2011-01-09 End date=2011-01-15
> 4th week -> Start date=2011-01-16 End date=2011-01-22
> 5th week -> Start date=2011-01-23 End date=2011-01-29
> 6th week -> Start date=2011-01-30 End date=2011-01-31


$d=mktime (0,0,0,1,1,2011);
for ($i=0; $i<35; $i++) {
$x=$d+($i*24*3600);
if (date("w",$x)==0) {
print date("W d-m", $x).date(" d-m\n", $x+(6*24*3600));
}
}

You need to change this in order to get it to work ;)


--
Luuk
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: hai sweety
Next Topic: Install GD on Windows
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 23:45:07 GMT 2024

Total time taken to generate the page: 0.04237 seconds