On Wed, 12 Mar 2003, Christian Hansen wrote: > First I would like to thank you all for your time and work with DateTime, > its highly appreciated! > > I believe this is a bug. > > [EMAIL PROTECTED] event]$ cat time.pl > #!/usr/bin/perl > > use strict; > use warnings; > use Date::Calc qw(Week_Number); > use DateTime; > > my $dt = DateTime->new( > year => 2003, > month => 6, > day => 1, > ); > > print "DateTime : ", $dt->week_number, "\n"; > print "Date::Calc : ", Week_Number( 2003, 6, 1 ), "\n"; > > [EMAIL PROTECTED] event]$ perl time.pl > DateTime : 23 > Date::Calc : 22 > > I was expecting 22.
You're somewhat right ;) DateTime.pm is definitely not conforming to the ISO 8601 week-year system, and that needs to be fixed. However, Date::Calc doesn't conform to this system either! It's closer, because AFAICT it's only difference is that it thinks there is a week 0, but ISO8601 does not. I'll fix DateTime.pm to conform to ISO 8601, but that will still leave it different from Date::Calc. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/
