A couple possible fixes:
• Alter DateTime::TimeZone::offset_as_seconds to accept 2 digit
offsets. This seems the easiest solution, and will add this capability
to all of the DateTime modules.

This doesn't seem like a terrible good idea.

In lieu of a real spec, it seems from http://hydracen.com/dx/iso8601.htm that -07 is a valid offset for 8601. However, to implement this part of the 8601 spec in DT::TZ seems misplaced.



• Alter DateTime::Format::Pg to pad the offset digits coming in from
postgres.  This is also fairly good, though the code would be
duplicated in DT::Fmt::ISO8601 (once the date + time parsing code is
written).

I think this is the best solution. DT::F::Pg could also just use DT::F::ISO8601 to parse ISO format output.


Ok - I think I'm going to take the cue from ISO8601 and write a offset fixup sub and add it to DateTime::Format::Pg. The format coming out of postgres isn't really ISO8601 (it uses a space for a delimiter between the date and time), and can't be parsed by the DT::F::ISO8601 as it is right now. This solution seems to have the best reward for the lowest risk.


Does anyone know how to get in touch with Claus Färber (the author of DT::F::Pg) to send my diffs?

-Jonah

Reply via email to