getpelican/pelican — pull request #928 by wking (2013-06-12 02:12:47+00:00)
Title: utils: Add some ISO 8601 forms to get_date()

Support the forms listed by the W3C [1]. I also removed the
'%Y-%d-%m' form, which can be confused with the '%Y-%m-%d' ISO form. The new
ISO forms can use 'Z' to designate UTC or '[+-]HHMM' to specify offsets from
UTC. Other time zone designators are not supported.

The '%z' directive has only been supported since Python 3.2 [2], so if you're
running Pelican on Python 2.7, you're stuck with 'Z' for UTC. Conveniently, we
get ValueErrors for both invalid directives and data/format missmatches, so we
don't need special handling for the 2.7 case inside get_date().

I don't think datetime.timezone is supported by Python 2.7, and that
might lead to more serious errors. Wait for Travis results before
merging this PR.

[1]: http://www.w3.org/TR/NOTE-datetime
[2]: http://bugs.python.org/issue6641