Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: No: of weeks in a month

by grumbert (Scribe)
on Sep 13, 2012 at 11:25 UTC ( #993461=note: print w/replies, xml ) Need Help??


in reply to No: of weeks in a month

I assume you are interested in the number of calendar weeks a month straddles rather than a simplified "February has 28 days so only 4 weeks in February..."

I don't really know of a module that gives that answer but Date::Calc has a Week_of_Year function which you could utilise (use it on first and last day of the month , then subtract the weeknumbers and add one), which should give you the number you're looking for...

Replies are listed 'Best First'.
Re^2: No: of weeks in a month
by Anonymous Monk on Sep 13, 2012 at 11:41 UTC
    Thanks for the reply :) will try that.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993461]
help
Chatterbox?
[ambrus]: Because that could break AnyEvent code, which is why I added a guard.
[ambrus]: (It might be easier to use the callback scalar as a guard, as in $c and &$c(); $c = ();)
[Corion]: ambrus: Hurr - yes, that might happen, as Prima will queue lots of stuff (Well, Windows will)
[Corion]: But I'm really amazed that it just took this little code (plus the idle handler I have in mind and something else dk suggested)
[Corion]: ambrus: I wrote the handler so that it stops the timer if it's supposed to be a one-shot
[Discipulus]: are you using Prima Corion? good morning Corion and ambrus, btw

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2016-12-09 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.