Generating RFC 822-style Date Strings

Here’s a snippet from my publishing tool that takes an “yyyymmdd”
or “yyyymmddhhmmss” string, and generates an RSS-compatible string.
It uses Python’s calendar module to calculate weekdays, and to get
day and month names. Tweak as necessary: