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