Hi, I'm trying to do something fairly simple, which is to add a duration and a datetime object ... but after trying many experimental code permutations, and reading the pod, I'm still obviously missing something here.

I create a DateTime::Duration object like so:

my $dur = DateTime::Duration->new( hours => $hours, minutes => $minutes);

Then attempt to add it to a datetime object ...

my $offset = $now + $dur;

But ... the hours value (often just 1) is never added to the offset ... and when checking $dur->hours, it says the duration has "0" hours! What's the deal?

Thanks,
-John

Reply via email to