Subject: | ISO8601DateTimeStr doesn't validate strings created by DateTime itself |
Consider:
$ perl -MDateTime -MMooseX::Types::ISO8601=ISO8601DateTimeStr
-wle'print DateTime->now->iso8601; print
ISO8601DateTimeStr->check(DateTime->now->iso8601) ? "pass" : "fail"'
2012-08-02T23:50:37
fail
According to my reading of http://en.wikipedia.org/wiki/ISO_8601, the
trailing Z is not a required part of the combined datetime string. It
is, however, preferred, so it would be reasonable for $dt->iso8601 to
include the trailing Z when time_zone eq 'UTC'.
If I don't hear any objections, I will change the appropriate regexp(s)
to treat the Z as optional, as well as push a change up into the
DateTime repository.