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.

    Chris
    M-x auto-bs-mode

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