Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: No: of weeks in a month

by Anonymous Monk
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

The Perl Monks Guide to the Monastery

 [weeks in month] -> no results, uh-oh

 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

 [day in month] -> day in month -> weeks in month -> Calculating latest 'Sunday' date on the first of the month, Determining the dayname for the last day of any given month, how can i find number of days in a given year and month

I am finished


Comment on Re: No: of weeks in a month
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993394]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (16)
As of 2015-07-30 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls