renard wrote:
I quote from perldoc DateTime:
 "DateTime.pm" always adds (or subtracts) days, then months, minutes, and
 then seconds. If there are any boundary overflows, these are normalized
 at each step.

Thanks renard,

Dave, if you're following this, can you tell me if there's a reason why you do this mixed up order?

Cheers!
Rick Measham


P.S. Dave, Here's quick hacks of the two functions I'd like to see added ... there's no checking that we really have a duration or anything like that...


sub add_lsb {
        my ($self, $duration) = @_;
        foreach (qw/nanosecond second minute hour day month year/) {
                $self->add( $_ => $duration->$_ ) if $duration->$_
        }
        return $self;
}

sub add_msb {
        my ($self, $duration) = @_;
        foreach (reverse qw/nanosecond second minute hour day month year/) {
                $self->add( $_ => $duration->$_ ) if $duration->$_
        }
        return $self;
}

Reply via email to