Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

days in a month

by Anonymous Monk
on Apr 06, 2001 at 01:03 UTC ( #70295=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

perl monks, Is there a way that given a certain month in a particular year that you can return the number of days in that month? I know that days are constant except for leap year, but how can I use the localtime or time functions to input two days and get the difference between them? thank you

Replies are listed 'Best First'.
Re: days in a month
by Adam (Vicar) on Apr 06, 2001 at 01:15 UTC
Re: days in a month
by lachoy (Parson) on Apr 06, 2001 at 01:15 UTC

    Check out the Days_in_Month routine from the Date::Calc module, which might already be installed on your system. If not, it's certainly available from CPAN and, I'm almost positive, from PPM as well.

    M-x auto-bs-mode

Re: days in a month
by aardvark (Pilgrim) on Apr 06, 2001 at 01:28 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://70295]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2018-07-20 13:11 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (431 votes). Check out past polls.