Refactor format rfc822 datetime.