in reply to Re: Re: Funky date question.
in thread Funky date question.
my @currenttime=(); ## or initialize to the start time my @totaltime=(); ## will hold the sums for each ID foreach (@databaseline) { ## realistically, this will be something like ## while (@values = $sth->fetchrow) when you convert to ## using SQL ( Look at the DBI module and the corresponding ## DBD module for your database ) my ($dbtime,$code,$id)= &parseline($_); ## This routine would split the line and convert ## the date, passing back the useful values. ## When you get it out of SQL, you should have an array ## of values anyway, so it'll only be necessary to ## convert the date. $totaltime[$id]+=($dbtime-$currenttime[$id]) if $code eq 'open'; $currenttime[$id]=$dbtime; ## we move the baseline to the time of the current record } ## now the @totaltime array has the values you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Funky date question.
by Mark 1 (Initiate) on Jun 09, 2001 at 12:18 UTC | |
by da (Friar) on Jun 09, 2001 at 16:01 UTC | |
by mpolo (Chaplain) on Jun 09, 2001 at 12:24 UTC | |
by Mark 1 (Initiate) on Jun 09, 2001 at 12:30 UTC |