http://www.perlmonks.org?node_id=204684


in reply to Another date related one.....

I prefer Time::Piece.
#!/usr/bin/perl -wT use strict; use Time::Piece; my $date1 = "01/01/2004"; my $date2 = "01/12/2003"; my $format = "%d/%m/%Y"; my $diff = Time::Piece->strptime($date1, $format) - Time::Piece->strptime($date2, $format); print $diff->days . " Days\n"; __END__ 31 Days

-Blake