|
|
| Welcome to the Monastery | |
| PerlMonks |
How to find the last date of the previous month?by MrSnrub (Sexton) |
| on Oct 30, 2012 at 02:39 UTC ( #1001445=perlquestion: print w/ replies, xml ) | Need Help?? |
|
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?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||