> FAQ answers should answer more questions then they generate, > but two obvious questions leap out of that code... > > 1. Why is set_time_zone() needed for this DateTime example?
Good point - that should be added to the description. > 2. Why use DateTime::Format::*MySQL* when the code may have nothing > to do with MySQL, it just happens to use the same, very common, format? It is a mySQL time format. > I do think there should be a DateTime::Format::Common with a > parse_datetime() that can handle common _unambiguous_ numeric formats. > > A single regex could handle all formats that follow the ISO 8601 > general left-to-right decreasing resolution style, with assorted > optional punctuation, plus optional appended TZ. Months ago I looked stealing the Date::Manip parser and decided to save that for a very rainy day. :) I did start to implement all of ISO8601 with DT::F::Builder but I haven't worked on it since April. Instead of a single large regex I'm going the many small regexs route. The problem is the ISO8601 defines a lot of unusual date formats - although releasing something with only partial compliance shouldn't be too hard. I'll try to get something into the workable state and release it later this week. -J --