Okay, I'm probably being stupid but...how do I get the number of seconds
a DateTime::Duration takes?  I *think* I should be using delta_seconds,
but that doesn't seem to work:

  use DateTime::Duration;
  my $dur = DateTime::Duration->new(hours => 2);
  print $dur->hours . ":" .
        $dur->minutes . ":" .
        $dur->seconds . "\n";

  print $dur->delta_minutes . ":" .
        $dur->delta_seconds . "\n";

Prints:

  2:0:0
  120:0

Shouldn't that print

  2:0:0
  120:7200

Or am I being really stupid?  It has been known.

FYI:

  bash-2.05b$ perl -v
  This is perl, v5.8.1 built for i386-linux-thread-multi
  bash-2.05b$ perl -MDateTime -e 'print $DateTime::VERSION'
  0.1901

(i.e. debian unstable perl and the latest DateTime off of CPAN)

Mark.

-- 
#!/usr/bin/perl -T
use strict;
use warnings;
print q{Mark Fowler, [EMAIL PROTECTED], http://twoshortplanks.com/};

Reply via email to