On Thu, Feb 14, 2002 at 12:08:34PM -0500, Yacketta, Ronald wrote:
> ($name, $date, $time, $wonid, $cheat, $server) = split(/\|/, $a);
> ($wday,$month,$mday,$year) = split(/\s+/, $date);
> ($hour,$min,$secs) = split(/:/, $time);
> $TIME = timelocal($secs,$min,$hour,$mday,$mon,$year);
>
> ($name2, $date2, $time2, $wonid2, $cheat2, $server2) = split(/\|/, $b);
> ($wday2,$month2,$mday2,$year2) = split(/\s+/, $date2);
> ($hour2,$min2,$secs2) = split(/:/, $time2);
> $TIME2 = timelocal($secs2,$min2,$hour2,$mday2,$mon2,$year2);
Time::Local::timelocal's month argument should be in the range 0..11.
Assuming your input has month dates in the range 1..12, you're off by one.
> # sort values
> if ($table_sort eq "adate") { return $TIME <=> $TIME2; }
> elsif ($table_sort eq "ddate") { return $TIME2 <=> $TIME; }
> elsif ($table_sort eq "name") { return $name <=> $name2; }
> elsif ($table_sort eq "wonid") { return $wonid <=> $wonid2; }
> elsif ($table_sort eq "cheat") { return $cheat <=> $cheat2; }
> }
Where is $table_sort set, and what is it set to?
> not sure why, but the output is not sorted as I would expect. I thought it
> would sort on the unix time and put thing in order, but it does not. the
> dates are sorted by the day of the month *boggle* for out put go here
> http://www.sampier.com/cheaters/busted.html
You give us sample output (which is difficult to read for date information,
consider splitting the middle column into more columns and using a
fixed-width font), but sample input is a little more important for
determining what's going wrong.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]