im importing data from an excel spreadsheet into an array of hashes.
the date is initially converted using Date::Format::Excel.

for this bit

{START} = unix start time .{START_DS} = string that I use to convert
to unixtime with

my $var=0;my [EMAIL PROTECTED];
while ($var<$va_length)
{
print "${$daylistsorted[$var]}{TH} ";
print   'from ';
print ${$daylistsorted[$var]}{START};
print ' to '.${$daylistsorted[$var]}{END_DS};
print "   duration  ";print   int((${$daylistsorted[$var]}{END}-$
{$daylistsorted[$var]}{START})/60);

if (exists(  ${$daylistsorted[$var+1]}{TH}  )   )
         {
print "\tinterval to next start "; print int ((${$daylistsorted[$var
+1]}{START}-${$daylistsorted[$var]}{END})/60);print " \n";
         }
$var++;
}                        }

Sat  04-08-2007
=========================
1 from 1186220100 to 2007:08:04 10:33   duration  58 interval to next
start 34
4 from 1186225620 to 2007:08:04 13:29   duration  142  interval to
next start 26

and when i change it to
#print ${$daylistsorted[$var]}{START};
print UnixDate(${$daylistsorted[$var]}{START}, '%Y:%m:%d %H:%M');

 I get this

Sat  04-08-2007
=========================
 1 from  to 2007:08:04 10:33   duration  58   interval to next start
34
 4 from  to 2007:08:04 13:29   duration  142  interval to next start
26


with both dates as strings


Sat  04-08-2007
=========================
1 from 2007:08:04 09:35 to 2007:08:04 10:33   duration  58   interval
to next start 34
4 from 2007:08:04 11:07 to 2007:08:04 13:29   duration  142  interval
to next start 26


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to