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


in reply to Time Difference

time() returns number of seconds since the epoch so to figure out if there is a difference of more than 12 hours all you have to do is check for the difference using seconds (12hours = 60*60*12).

if ($current_time - $oldtime > 43200) { print "There is > 12 hour difference\n"; }

If you need to do more complex date/time calculations you may benefit from the many date modules on CPAN.