MrSnrub has asked for the wisdom of the Perl Monks concerning the following question:
How do I find out the last day of the previous month? In other words, I want a subroutine that, when run today, will return "09/30/2012" (a string in mm/dd/yyyy format)? If the function is run a week from now it will return "10/31/2012"? And if the function was run sometime last March, it would return "02/29/2012" (leap-year day). How do I do this?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to find the last date of the previous month?
by moritz (Cardinal) on Oct 30, 2012 at 05:27 UTC | |
Re: How to find the last date of the previous month?
by Athanasius (Archbishop) on Oct 30, 2012 at 03:26 UTC | |
Re: How to find the last date of the previous month?
by Anonymous Monk on Oct 30, 2012 at 03:03 UTC | |
Re: How to find the last date of the previous month?
by tobyink (Canon) on Oct 30, 2012 at 08:11 UTC | |
Re: How to find the last date of the previous month?
by Anonymous Monk on Oct 30, 2012 at 10:44 UTC | |
Re: How to find the last date of the previous month?
by MrSnrub (Beadle) on Oct 30, 2012 at 10:49 UTC | |
Re: How to find the last date of the previous month?
by larryl (Monk) on Nov 04, 2012 at 20:08 UTC |
Back to
Seekers of Perl Wisdom