in reply to subroutine for calculating day since 1900 needed


Here is one way using Date::Calc, but there are a lot of other modules you could use as well. This assumes that the epoch is 0/0/1900 as opposed to 1/1/1900 but either way it is easy to change.
#!/usr/bin/perl -wl use strict; use Date::Calc 'Delta_Days'; print days_since_1900(1900, 1, 1); print days_since_1900(2006, 5, 13); sub days_since_1900 { my $years = $_[0]; my $months = $_[1] || 1; my $days = $_[2] || 1; my @date = ($years, $months, $days); my @epoch = (1900, 1, 1, ); my ($days_since_1900) = Delta_Days(@epoch, @date); return 1 + $days_since_1900; }

--
John.