If I use $osheetCR->{Val} the value is in incremental serial numbers from 1 jan 1900 (or 1 jan 1904 for Apple users).
Example: 12-1-1946 is 16814

I can convert 16814 back to the real date with the date::calc but there must be some way to extract the year in the right format (yyyy and not yy).

Max

NYIMI Jose (BMB) wrote:

$oSheetCR->Value #formatted value
$oSheetCR->{Val} #original value

José.


-----Original Message-----
From: Max [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 4:50 PM
To: [EMAIL PROTECTED]
Subject: Spreadsheet::ParseExcel date problem (year is being reformatted)


When I read an Excel file in, ParseExcel reformates the year to dd-mm-*yy* (for example 10 dec 2002 is 10-12-*02*).
I don't want this to happen, the format should stay the way it was dd-mm-*yyyy* (10-12-*2002*).

Here is the code:

use Spreadsheet::ParseExcel; # Spread-ParseExcel [0.26]
my $oExcel = new Spreadsheet::ParseExcel;
my $oBook = $oExcel->Parse('mail/file.xls');

my($iRow, $iColom, $oWorkSheet, $oSheetCR);

my $iSheet=0;
my @string; $oWorkSheet = $oBook->{Worksheet}[$iSheet];

for (my $iRow = $oWorkSheet->{MinRow}; defined $oWorkSheet->{MaxRow} && $iRow <= $oWorkSheet->{MaxRow} ; $iRow++){
for(my $iColom = $oWorkSheet->{MinCol} ; defined $oWorkSheet->{MaxCol} && $iColom <= $oWorkSheet->{MaxCol} ; $iColom++) {
$oSheetCR = $oWorkSheet->{Cells}[$iRow][$iColom];
push @string,$oSheetCR->Value if ($oSheetCR);
}
}

Any help is appreciated,

Max



**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent.



Reply via email to