fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

good morning I am trying to parse an xlsx file with Spreadsheet::XLSX There are text data that appears on the Excel sheet as 'Thu, Jan 14' where the extracted data has the value '42387'. Any clue how I can parse this value to derive the text date?
  • Comment on parse Excel number which represents a date

Replies are listed 'Best First'.
Re: parse Excel number which represents a date
by Corion (Patriarch) on Aug 28, 2015 at 13:59 UTC

    That is how Excel represents dates. See Spreadsheet::ParseExcel for the routines that convert from numbers to formatted strings or just use the formatted value instead of the raw value. Maybe also consider Spreadsheet::ParseXLSX, which is more recent.

      Success with 'Spreadsheet::ParseXLSX'. Thanks to Corion and others who suggested possibilities.
Re: parse Excel number which represents a date
by tangent (Parson) on Aug 28, 2015 at 15:13 UTC
    How are you getting the value of the cell? If you use:
    $cell->{Val}
    then you will get the unformatted value, but if you use:
    $cell->value()
    you should get the formatted value
Re: parse Excel number which represents a date
by MidLifeXis (Monsignor) on Aug 28, 2015 at 14:37 UTC

    See also CPAN.

    --MidLifeXis

Re: parse Excel number which represents a date
by fionbarr (Friar) on Aug 28, 2015 at 14:01 UTC
    more info:

    the date is '1/14/2016' which is represented by the number '42387'