Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些创建 RSS 提要的代码,但在生成发布日期时遇到问题
<pubDate>%s</pubDate>
如何创建函数或使用函数来获取当前日期和时间,但采用英国日期/时间格式?
提前致谢 - Hyflex
脚本:
import datetime def pubdate(tag): return '<{tag}>{date}</{tag}>'.format( date = datetime.date.today().strftime("%d %B %Y"), tag = tag )
演示:
print pubdate('pubDate')
输出:
<pubDate>17 June 2013</pubDate>