use DateTime::Decorated
   with => [
'strftime', # Yes, pull it out of DT and put it in
         # DT:Format:Strftime and DT:Decorated:Strftime
       'strptime',
         # DT:Decorated:Strptime is an accessor interface to DT:F:Strp
      'common',
         # This will have all the 'ymd', 'mdy', 'dmy', 'hms' accessors
   ],
   as => 'DTD';

my $dtd = DTD->now;
print $dtd->hms();
# 10:10:23

I actually would rather see an mod_perl-style 'add if requested' style.

  use DateTime; # load just the basics
  use DateTime::Format qw(strftime strptime hms);
        # maybe use DateTime::Format qw(:common) ?

  my $dt = DateTime->now;
  print $dtd->hms;

At least, I don't much like the idea of having to use a different class name like 'DTD'

--d

Reply via email to