in reply to Time::Local - calculate months elapsed

Lori713,
Here is a TIMTOWTDI solution. The Seconds2English module you will not find on CPAN as I wrote for learning purposes. The code has been cleaned up a bit - but that is on a hard drive sitting on a shelf.
#!/usr/bin/perl -w use strict; use Time::Local; use Seconds2English; my $date1 = epoch('2004-02-24'); my $date2 = epoch('1999-06-30'); my $diff = Seconds2English->new('start' => $date2 - $date1); print "The difference is " , int $diff->in_months, " months\n"; sub epoch { my ($year, $month, $day) = split '-' , shift; return timelocal(0 , 0 , 12, $day , $month - 1, $year); } __END__ The difference is 56 months
Of course, it is possible to change the definition of what a "month" is as well as all kinds of cool doodads. You only need to copy the module into the same directory as you are running your code.

Cheers - L~R