dpmott has asked for the wisdom of the Perl Monks concerning the following question:
I get the following output:#!perl -w use strict; use Date::Calc qw/Localtime Delta_DHMS Delta_YMDHMS/; my $now = time(); my $total = 63072000; # approx 2 years doit( $now, $now + $total ); doit( $now - $total, $now ); sub doit { my ( $start, $end ) = @_; my @ts1 = (Localtime( $start ))[0..5]; my @ts2 = (Localtime( $end ))[0..5]; my ($years, $months, $days, $hours, $mins, $secs) = Delta_YMDHMS(@ts1, @ts2); print "$years years, $months months, $days days, $hours hours, $min +s minutes\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Date::Calc::Delta_YMDHMS?
by dpmott (Scribe) on Mar 14, 2004 at 03:01 UTC |