Nov 4, 2005 #1 jdbolt Programmer Aug 10, 2005 89 CA Hi, I need a way to get the last and first day of teh week given a week and year number, 45 (week) and 2005 (year) for example. Could any provide insight into how this might be done?
Hi, I need a way to get the last and first day of teh week given a week and year number, 45 (week) and 2005 (year) for example. Could any provide insight into how this might be done?
Nov 4, 2005 #2 TrojanWarBlade Programmer Apr 13, 2005 1,783 GB Check out Date::Manip and Date::Calc on cpan. Trojan. Upvote 0 Downvote
Nov 4, 2005 Thread starter #3 jdbolt Programmer Aug 10, 2005 89 CA yeah I have that module installed, I was hoping someone could give me some ideas on how to solve the problem, Upvote 0 Downvote
yeah I have that module installed, I was hoping someone could give me some ideas on how to solve the problem,
Nov 4, 2005 #4 PaulTEG Technical User Sep 26, 2002 4,469 IE Have you read the docs for the modules? Spend an hour a week on CPAN, helps cure all known programming ailments ;-) Upvote 0 Downvote
Have you read the docs for the modules? Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
Nov 7, 2005 #5 MrSm1th MIS Jun 3, 2005 6 US use Date::Calc qwall); use Date::Calendar; ($year,$month,$day) = Today(); my ($sec,$min,$hour,$mday,$mon,$year, $wday,$yday,$isdst) = localtime time; $year += 1900; $mon++; $week = int(($day + Day_of_Week($year,$month,1) - 2) / 7) + 1; $dow = Day_of_Week($year,$month,$day); $DayOfWeek = Day_of_Week_to_Text($dow); Example: ($month == 11 && $week == 4 && $DayOfWeek eq "Thursday") && do{ # Thanksgiving Day Hope this helps. Upvote 0 Downvote
use Date::Calc qwall); use Date::Calendar; ($year,$month,$day) = Today(); my ($sec,$min,$hour,$mday,$mon,$year, $wday,$yday,$isdst) = localtime time; $year += 1900; $mon++; $week = int(($day + Day_of_Week($year,$month,1) - 2) / 7) + 1; $dow = Day_of_Week($year,$month,$day); $DayOfWeek = Day_of_Week_to_Text($dow); Example: ($month == 11 && $week == 4 && $DayOfWeek eq "Thursday") && do{ # Thanksgiving Day Hope this helps.