摘要: 对于像'Wed, 11 Apr 2012 09:37:05 +0800'的时间格式化可如下解:>>> date='Wed, 11 Apr 2012 09:37:05 +0800'>>> dd=datetime.datetime.strptime(date,'%a, %d %b %Y %H:%M:%S %z')>>> dd.strftime('%Y-%m-%d %H:%M:%S')Python格式化日期时间的函数为datetime.datetime.strftime();由字符串 阅读全文
posted @ 2012-04-18 10:23 代码示例 阅读(23022) 评论(2) 推荐(1) 编辑