I am using Spreadsheet::XLSX to read a standard excel spreadsheet. The last column is a date field.
However, it doesnt appear to be converting correctly as a dumper of the cell shows
$VAR1 = bless( { 'Type' => 'Date', 'Val' => 'MM/03/2017 HH:29:59', '_Value' => 'MM/03/2017 HH:29:59', 'Format' => 'MM/dd/yyyy HH:mm:ss' }, 'Spreadsheet::ParseExcel::Cell' );
Relevent code is pretty much standard from what I found on the web
foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxR +ow}) { my($first) = 1; $sheet -> {MaxCol} ||= $sheet -> {MinCol}; foreach my $col ($sheet -> {MinCol} .. $sheet + -> {MaxCol}) { my $cell = $sheet -> {Cells} [$row] [$ +col]; if ($cell) { unless (defined($firstrow)) { print CSV ',' unless ( +$first); print CSV $cell -> va +lue(); } $first = undef; $last = $cell -> value(); print Dumper($cell); } }
Anybody have any ideas?
2017-08-04 Athanasius added code tags
In reply to Problem with Spreadsheet::XLSX (Date formatting) by kelliott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |