* Joshua Hoblitt ([EMAIL PROTECTED]) [20 Mar 2003 10:40]:

[...]
> I'm wondering if maybe we need a DateTime::Format::Custom or maybe
> just a DateTime::Format as a base class ? That you give a
> DateTime::Format::ICal::valid_formats style definition too.

DateTime::Format::(Builder|Generic|Factory) (I forget what the
patterns folk are into these days)

> my $custom_parser = DateTime::Format::Custom->format(
>       15 => {
>               params => [ qw( year month day hour minute second ) ],
>               regex  => qr/^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)$/,
>               zero   => {},
>       },
>       ...
> );

Not sure I'd have the '15' bit there. Or is that to let it try
multiple parses?

> $custom_parser->parse_datetime( ... );

> Or is this just a stupid idea?

I like it. Need a formatter too though. e.g.

    strftime => "%c"
    strftime => sub { shift->datetime }

or something.


cheers,
-- 
Iain.                                          <http://eh.org/~koschei/>

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to