Hi,

Somewhere along the way, an RSS feed broke with "Invalid format for date!".
This was following a site restore from a very old backup, and I needed to
install the perl modules from scratch. I don't know whether it was due to a
newer XML::RSS or DateTime, but the problem is as follows:

say DateTime->now(time_zone => 'GMT')->strftime('%a, %d %b %Y %T %Z');

==> Thu, 06 May 2010 00:10:20 UTC

According to XML:RSS's documentation, dates should be specified according to
RFC822 (http://asg.web.cmu.edu/rfc/rfc822.html#sec-5). Looking this up, I
get:

zone        =  "UT"  / "GMT"  (Plus some others)

Unfortunately, Datetime's %Z of UTC matches neither of these. My workaround
is to actually hardcode the time zone name in the format string, but this
strikes me a s being a bit of a hack. Is there a better approach.

Dan

Reply via email to