> On Sat, 1 Nov 2003, Iain Truskett wrote:
>
> > This any use?
> >
> > perl -MDateTime::Format=Mail -wle 'print DateTime->now->format_mail'
> > Sat, 01 Nov 2003 06:34:12 -0000
> >
> > % perl -MDateTime::Format=HTTP -wle 'print DateTime->now->format_http'
> > Sat, 01 Nov 2003 06:34:23 GMT
> >
> > % perl -MDateTime::Format=ICal -wle 'print DateTime->now->format_ical'
> > 20031101T063430Z
> >
> > % perl -MDateTime::Format=Pg -wle 'print DateTime->now->format_pg'
> > 2003-11-01 06:34:35+0000
>
> I suggested this way, way, way back when this project first started, and a
> lot of people really objected to polluting the main DateTime namespace
> like this, and I kind of see their point, even though it is darn
> convenient.
>
> I think releasing this as a separate module is reasonable, with
> appropriate caveats in the docs.

Would this be better as a decorator that adds a format_datetime method?

(decorator setup)
DateTime::Format=Pg
print DateTime->now->format_datetime

2003-11-01 06:34:35+0000

-J

--

Reply via email to