in reply to how to get the time difference

Have a look at Date::Calc at CPAN.