Hi John & Iain > On Sunday, July 13, 2003, at 08:11 PM, Iain Truskett wrote: > > Remember: part of the point of having the various format > > modules is that you can pick'n'mix. You could conceivably > > wrap a number of them in Builder to make your own parser > > that recognizes the sorts of dates you come across. I mostly
I think an example of this type of thing needs to go into the FAQ. Do you have an example of doing this? > > come across HTTP, W3CDTF and RFC2822 dates so I'm all set =) > > Sure, but my main point is that I don't want to have to > manually load and use parsers. I want DateTime (the class and/or > individual objects) I agree with you on this. I feel that there should be a default simple parser within datetime. > have a catch-all parse() method that uses the parser class of my > choosing. And I want the default to be something than can > handle most "normal" date formats, ignoring as much complexity as it > takes to get into the "core" (even though DateTime::Format::Simple > would still be its own module, and might not even be loaded > until the first call to parse()) > > > However, I'm interested in seeing your regex to see if you > > parse anything that might be of use to me. Would you like to > > share? > > They're super boring. Heck, these two cover almost everything I'm > interested in: > [snipped] > > Really, I'm not asking for the moon. The key features are the > "built-in/used by default" nature and the "I can handle whatever" > parse() method (instead of parse_date(), parse_datetime(), > parse_year_and_day_but_not_month(), etc.) Since this is all > so simple, I think it should be "built in" via the creation > and default use of a DateTime::Format::Simple module and > a generalized parse() class/object method for DateTime. [much snippage] John, Can I encourage you to put together a Format::Simple module and release it? I think we need something out there for very basic date parsing. There is the DateTime::Format::HTTP that comes very close ( It works great on Ingres dates/times). Or maybe the regrex that you provided can be incorporated into HTTP? What do you think? Ron Hill
