or download this
#Begin###Calculate the time difference
my $dtnow = DateTime->now;
...
my $diff_sec = $dtnow->subtract_datetime_absolute($dtevent)->in_units(
+'seconds');
my $diff_hours = sprintf("%.0f" , $diff_sec/(60*60));
#End###Calculate the time difference