HOWEVER, that said, I'd like to see some sort of a default format
method:
        $dt->set_default_format($strftime_format);
        print $dt->default_format;
        print "Stringified with default: $dt";


Someone came up to me at OSCON and asked about whether I wanted a patch
for this and I said yes.  I think it might've been Michael Schwern.

I'd prefer being able to pass a formatter:

  http://marc.theaimsgroup.com/?l=perl-datetime&m=108995979225140&w=2

Then if your formatter supports strftime notation, you could just do

  my $dt = DateTime->new( ...,
    formatter => My::Formatter->new(pattern => $strftime_pattern)
  );

  print "$dt\n";

This has a significant advantage for non-English users who just want their DT objects magically appear in the format of their choice...

(Although, now that I think about it this raises a problem with cyclic dependencies between DateTime and the default formatter (presumably DT::F::Strptime)

--d



Reply via email to