In the module Spreadsheet:ParseExcel:Utility, in the sub ExcelLocaltime, the calculations do not take into account years that are mod 4 , mod 100 , but not mod 400.
line 1165 $iMD++ if $iMon == 2 and $iYear % 4 == 0 ;
should read $iMD++ if $iMon == 2 and $iYear % 4 == 0 and ( $iYear % 100 ) || ( $iYear % 400 ) == 0 ;
Additionally, the conversion to local time year ( difference form 1900 ) should occur after the month calculations, so you are checking the real year and not the difference. ( line 1170 not 1162 )
Example : year =2100 is divisible by 4 , but not a leap year because it is divisible 100 but not 400.
I have included the original Utility.pm , Utility_fix.pm, an excel file with dates, and a perl script parse_excel_dates.pl
Thanks
Note : line numbers may be +- 1 due to white space conversion.
In the module Spreadsheet:ParseExcel:Utility, in the sub ExcelLocaltime, the calculations do not take into account years that are mod 4 , mod 100 , but not mod 400. line 1165 $iMD++ if $iMon == 2 and $iYear % 4 == 0 ; should read $iMD++ if $iMon == 2 and $iYear % 4 == 0 and ( $iYear % 100 ) || ( $iYear % 400 ) == 0 ; Additionally, the conversion to local time year ( difference form 1900 ) should occur after the month calculations, so you are checking the real year and not the difference. ( line 1170 not 1162 )
Example : year =2100 is divisible by 4 , but not a leap year because it is divisible 100 but not 400.
I have included the original Utility.pm , Utility_fix.pm, an excel file with dates, and a perl script parse_excel_dates.pl
Thanks Note : line numbers may be +- 1 due to white space conversion.
parse_excel_date.zip