DateTime::Format::Excel 0.2901 review

Download
by rbytes.net on

DateTime::Format::Excel is a Perl module that can convert between DateTime and Excel dates. SYNOPSIS use DateTime::Format::

License: Perl Artistic License
File size: 15K
Developer: Iain Truskett
0 stars award from rbytes.net

DateTime::Format::Excel is a Perl module that can convert between DateTime and Excel dates.

SYNOPSIS

use DateTime::Format::Excel;

# From Excel via class method:

my $datetime = DateTime::Format::Excel->parse_datetime( 37680 );
print $datetime->ymd('.'); # '2003.02.28'

# or via an object

my $excel = DateTime::Format::Excel->new();
print $excel->parse_datetime( 25569 )->ymd; # '1970-01-01'

# Back to Excel number:

use DateTime;
my $dt = DateTime->new( year => 1979, month => 7, day => 16 );
my $daynum = DateTime::Format::Excel->format_datetime( $dt );
print $daynum; # 29052

# or via an object
my $other_daynum = $excel->format_datetime( $dt );
print $other_daynum; # 29052

Excel uses a different system for its dates than most Unix programs. This module allows you to convert between a few of the Excel raw formats and DateTime objects, which can then be further converted via any of the other DateTime::Format::* modules, or just with DateTime's methods.

If you happen to be dealing with dates between 1 Jan 1900 and 1 Mar 1900 please read the notes on epochs.

If you're wanting to handle actual spreadsheet files, you may find Spreadsheet::WriteExcel and Spreadsheet::ParseExcel of use.

Requirements:
Perl

DateTime::Format::Excel 0.2901 search tags