![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
Dates - which Tuesday is itby viffer (Beadle) |
on Sep 17, 2013 at 00:12 UTC ( #1054360=perlquestion: print w/replies, xml ) | Need Help?? |
viffer has asked for the wisdom of the Perl Monks concerning the following question:
Hi all-knowing. wonderful, helpful folks (I hope that's enough grovelling)?.. I have two ..tasks..I need to perform concerning date manipulation. I've searched high and low without success. Firstly, I'm wondering if there's a perl module that enables me to find out whether a Tuesday is the 1st, 2nd, 3rd, 4th or 5th Tuesday in the month. I need to run a process that does one thing on one Tuesday and an alternate thing on the next Tuesday, ad infinitum. I'm guessing the way to do it would be to find the odd/even numbered Tuesdays from epoch, but I'm buggered if I can work out how to do it. The second issue I have is working out if a date 15 days from a given date is a weekend, i.e. if I'm given day 5 as input, I need to ascertain if day 20 is a weekend, so that I can run the job on the preceding Friday (18th or 19th). I appreciate you prefer people to show the code they've written and the issues they've found, but quite honestly I've not been able to come up with anything worthwhile that isn't long winded or comes even close to working. I really would appreciate any suggestions I could try
Thanks very much
Back to
Seekers of Perl Wisdom
|
|