Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the DateManip CPAN distribution.

Report information
The Basics
Id: 25159
Status: resolved
Priority: 0/
Queue: DateManip

People
Owner: Nobody in particular
Requestors: bill [...] cosi.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.44
Fixed in: (no value)



Subject: Date_DayOfWeek broken
Download (untitled) / with headers
text/plain 947b
#!/usr/bin/perl use Date::Manip; $version = DateManipVersion; print "Version $version\n"; # Notice how the Date_DayOfWeek behaves. sub tcase { my ($smon,$sdom,$syr,@xs) = @_; my $ndow = Date_DayOfWeek($sdom,$smon,$syr) - 1; my $sdow = ( "Mon","Tue","Wed","Thu","Fri","Sat","Sun" )[$ndow]; my $elaps = Date_SecsSince1970($smon,$sdom,$syr,0,0,0); my $odo = int($elaps/86400-4) % 7; my $csdow = ( "Mon","Tue","Wed","Thu","Fri","Sat","Sun" )[$odo]; print "Y-M-D: $syr-$smon-$sdom: $ndow($sdow), $odo($csdow)\n"; } foreach $d (1..7) {&tcase(1,$d,2007);} --------------------------------------------------------------------- -----------result of run: bill@phex:~/biz/bill/calendar> perl tc Version 5.44 Y-M-D: 2007-1-1: 0(Mon), 0(Mon) Y-M-D: 2007-1-2: 3(Thu), 1(Tue) Y-M-D: 2007-1-3: 3(Thu), 2(Wed) Y-M-D: 2007-1-4: 6(Sun), 3(Thu) Y-M-D: 2007-1-5: 1(Tue), 4(Fri) Y-M-D: 2007-1-6: 4(Fri), 5(Sat) Y-M-D: 2007-1-7: 6(Sun), 6(Sun)
Download (untitled) / with headers
text/plain 220b
The arguments to Date_DayOfWeek are in the wrong order. They should be (for unfortunate historical reasons to maintain backward compatibility): MONTH, DAY, YEAR. You entered them as (the more sensible) DAY, MONTH, YEAR.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.