Date::WeekOfYear - Simple routine to return the week of the year (as well as the year)
use Date::WeekOfYear;
# Get the week number (and year for the end/start of year transitions) my ($wkNo, $year) = WeekOfYear();
# Use the data for someThing ... my $logFile = "/someDir/$year/someApp_$wkNo.log"
# Only want the week number, don't care which year in the week around # the end/start of the year ! my $weekNo = WeekOfYear();
Date::WeekOfYear is small and efficient. The only purpose is to return the week of the year. This can be called in either a scalar or list context.
In a scalar context, just the week number is returned (the year starts at week 1).
In a list context, both the week number and the year (YYYY) are returned. This ensures that you know which year the week number relates too. This is only an issue in the week where the year changes (ie depending on the day you can be in either week 52 or week 1.
Note there if you are after other date related functions then there are plenty of other Date::* modules on CPAN provide the functionality of this module in addition other ...
WeekOfYear. That's it, nice and simple
None, however please contact the author at gng@cpan.org should you find any problems and I will endevour to resolve then as soon as possible
Greg George, IT Technology Solutions P/L, Australia Mobile: +61-404-892-159, Email: gng@cpan.org
Date::Parse or check CPAN http://search.cpan.org/search?query=Date&mode=all
$Log: WeekOfYear.pm,v $ Revision 1.1.1.1 2004/08/09 11:07:15 Greg - Initial release to CPAN
$Id: WeekOfYear.pm,v 1.1.1.1 2004/08/09 11:07:15 Greg Exp $