Welcome to the Monastery PerlMonks

### Re: No: of weeks in a month

 on Sep 13, 2012 at 07:33 UTC ( #993394=note: print w/replies, xml ) Need Help??

in reply to No: of weeks in a month

Welcome, I will guide you

brain .oO( what is a week? what is a month? )

Hmm, a week is seven days

A month is 28 to 31 days

Hmm, days in month , divided by seven, equals weeks in month

I am finished

Replies are listed 'Best First'.
Re^2: No: of weeks in a month
by bimleshsharma (Beadle) on Sep 13, 2012 at 11:16 UTC

Hmm, I am trying to explain.

```my %daysinmonth=(Jan=>31,Feb=>30,Mar=>31,Apr=>30,May=>31,Jun=>30,Jul=>
+31,Aug=>31,Sep=>30,Oct=>31,Nov=>30,Dec=>31);

\$weeks_count= \$daysinmonth{enteryourmonth}/7;
\$day_count= \$daysinmonth{enteryourmonth}-(\$weeks_count*7);

print "Only \$weeks_count weeks in \$daysinmonth{enteryourmonth} month";
enjoy!!!
Re^2: No: of weeks in a month
by Anonymous Monk on Sep 13, 2012 at 11:49 UTC

I have asked for some specific date module which help in this calculation

DateTime is the Swiss army chainsaw of date calculations.

Create A New User
Node Status?
node history
Node Type: note [id://993394]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2017-08-20 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Who is your favorite scientist and why?

Results (313 votes). Check out past polls.

Notices?