#!/usr/bin/perl -w use strict; use Date::Calc; my ($nwyr,$nwmth,$nwday, $nwhr,$nwmin,$nwsec) = Date::Calc::Today_and_Now(); my $dttm1 = "2002-03-06 12:10:52"; my ($d1yr, $d1mth, $d1day, $d1hr, $d1min, $d1sec) = ($dttm1 =~ /(\d*)-(\d*)-(\d*) (\d*):(\d*):(\d*)/); my ($Ddays,$Dhrs,$Dmins,$Dsecs) = Date::Calc::Delta_DHMS($nwyr,$nwmth,$nwday, $nwhr,$nwmin,$nwsec, $d1yr,$d1mth,$d1day, $d1hr,$d1min,$d1sec); my $totMinsDiff = abs(($Ddays * 24 * 60) + ($Dhrs * 60) + ($Dmins) + ($Dsecs / 60)); print "Absolute difference in minutes is: $totMinsDiff \n";