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


in reply to how to get the time difference

Have a look at Date::Calc at CPAN.