Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

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";
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993394]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2018-06-18 11:21 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (109 votes). Check out past polls.