You need to convert date strings into DateTime objects first, using a
customized format or one of the many DateTime::Format::* libraries available.
You're using a format commonly used in databases, so I've selected the MySQL
formatter (and then defined a custom duration formatter for the end result,
copied from the examples in
DateTime::Format::Duration):
use DateTime;
use DateTime::Format::MySQL;
use DateTime::Format::Duration;
my $date = "2010-08-02 09:10:08";
my $dt1 = DateTime->now(time_zone => 'floating', formatter => 'DateTime::Format::MySQL');
my $dt2 = DateTime::Format::MySQL->parse_datetime($date);
my $duration = $dt1 - $dt2;
my $format = DateTime::Format::Duration->new(
pattern => '%Y years, %m months, %e days, %H hours, %M minutes, %S seconds'
);
print $format->format_duration($duration);
# prints:
# 0 years, 00 months, 0 days, 00 hours, 421 minutes, 03 seconds