xls2csv: wrong date cells parsing

parsing, xls

Solution

Tools xls2csv is a Perl application that uses `Spreadsheet::ParseExcel` library.

Based on such library documentation, one of known problems is:

- If Excel has date fields where the specified format is equal to the system-default for the short-date locale, Excel does not store the format, but defaults to an internal format which is system dependent. In these cases ParseExcel uses the date format 'yyyy-mm-dd'.

So you probably manipulate with Excel file that does not contain date formating due to above listed issue.

Problem

I format dates with the command line option -f %Y-%m-%d or even %d-%b-%y but each date comes out four years and one day ahead of the date I input for example, date `01.06.2012` after parsing without -f option comes as `2016-06-02` toying with -f gives same result What is the reason? Are there any workarounds, except hardcode and substract back these 4 years and 1 day? I am using xls2csv (by V.B.Wagner, comes with catdoc package in debian) and switching to another parser can be very expensive option

Original source