in reply to Re: Time diff
in thread Time diff

Thank, That did work, but now I have to find an average.
Do you suggest the same module, I didn't see any doc supporting this?

Replies are listed 'Best First'.
Re^3: Time diff
by tall_man (Parson) on Mar 27, 2003 at 02:46 UTC
    The module would work for finding an average time, like this:
    use strict; use DateTime::Precise; my $t1 = DateTime::Precise->new('2003. 3.26 16:14:13.8167'); my $t2 = DateTime::Precise->new('2003. 3.26 16:23:14.6152'); my $average = $t1 + ($t2 - $t1)/2.0;
    The subtraction produces a time in seconds, and the module provides a way to add seconds to a time. So just add half the difference and you will have the average.