madtoperl has asked for the wisdom of the Perl Monks concerning the following question:
--------###Get the intime value foreach my $sheet (@{$workbook->{Worksheet}}) { printf("Sheet Name : %s\n", $sheet->{Name}); foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow} ){ foreach my $col ($sheet->{MinCol} .. $sheet->{MaxCol}) + { if ($sheet->{Cells}[$row][$col]->{Val} eq "GRANTED"){ print"Granted Row=> $row column=> $col\n"; my $inTime = $sheet->{Cells}[$row][0]->{Val}; print"Intime=> $inTime\n"; my $datetime = DateTime::Format::Excel->parse_date +time( $inTime ); #print $datetime->ymd('.'); # '2003.02.28' my $idate = $datetime->ymd('.'); print "Date is [$idate]\n"; } if ($sheet->{Cells}[$row][$col]->{Val} eq "Authorized" +){ print"Authorized Row=> $row column=> $col\n"; my $outTime = $sheet->{Cells}[$row][$col+2]->{Val} +; print"Outtime=> $outTime\n"; my $datetime = DateTime::Format::Excel->parse_date +time( $outTime ); #print $datetime->ymd('.'); # '2003.02.28' my $odate = $datetime->ymd('.'); print "out Date is [$odate]\n"; } } } } ####
Granted Row=> 51 column=> 8 Intime=> 39783.4122916667 Date is [2008.12.01] Authorized Row=> 52 column=> 6 Outtime=> 39783.4125 out Date is [2008.12.01]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert between DateTime and Excel dates
by 1Nf3 (Pilgrim) on Jan 12, 2009 at 13:04 UTC | |
by madtoperl (Hermit) on Jan 12, 2009 at 13:45 UTC | |
|
Re: Convert between DateTime and Excel dates
by Corion (Patriarch) on Jan 12, 2009 at 12:31 UTC |