[Silva-general] How do I convert silva-extra creationtime to RFC-822?

Nico Grubert nicogrubert at gmail.com
Fri Mar 3 15:36:24 CET 2006

> I'm writing a little podcast product that will allow users to upload mp3's to a
> folder which generates the xml for an itunes podcast only problem is I'm having
> trouble validating the xml for the <pubDate>, the specification says it must be
> an RFC-822 date-time. So the question is, how do I convert it to RFC-822?
> mdbinding = self.service_metadata.getMetadata(self)
> creationdate = mdbinding.get('silva-extra', 'creationtime')
> crdate = creationdate.HTML4()
> xml.write('<pubDate>%s</pubDate>\n' % quote_xml(crdate))

Hi John,

not sure, if it works for you but you could try:

   dt = DateTime(creationdate)
   return dt.rfc822()


More information about the Silva-general mailing list