You can use Time::Local module to get current time and difference can be calculated using Date::Calc. Depends on your requirement of date-time formats and what you actually want to achieve by calculating the time difference.
Comment on Re: Simple time differences in microseconds