Convert serial value to perl

I use Spreadsheet::XLSXto convert XLSX to CSV on Linux. Custom date fields are converted to numbers. I know that XLSX stores user dates as sequential values. I need to find a way to convert these values ​​to dates / times.

Example:

CSV:  40829
XLSX: 10/13/2011 0:00

So, I'm trying to figure out how to convert 40829to10/13/2011 0:00

I did some research and I could not find a solution (Perl). I can provide the code if necessary.

Please inform.

Thanks, Andrew

+4
source share
2 answers

Excel , 1900-Jan-0, 24- : ddddd.tttttt.

, , , cpan , DateTime::Format::Excel , , DateTimeX::Format::Excel , .

+7

, , 1 1900 . 40828 1900 (, 1 , 0), :

use POSIX 'mktime'

my $epoch = mktime 0,0,0, 40829-1,0,0;

print scalar localtime($epoch);

Thu Oct 13 00:00:00 2011
+2

All Articles