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


in reply to Average start time handling midnight

There are date functions that will just give you the elapsed time. They should even be able to account for different timezones. http://search.cpan.org/~drolsky/DateTime1.34/lib/DateTime.pm#Datetime_Subtraction Another option is to convert the dates to unix time and subtract, then figure out how many hours, minutes and seconds elapsed. This is a great place to just use a library rather than build something new.