Python 日付変換

8.1. datetime — 基本的な日付型および時間型 — Python 3.3.6 ドキュメント

import datetime
import time

#struct_timeを変換
entry.published_parsed = time.struct_time(tm_year=2015, tm_mon=1, tm_mday=2, tm_hour=3, tm_min=4, tm_sec=5, tm_wday=4, tm_yday=2, tm_isdst=-1)

datetime.datetime.fromtimestamp(time.mktime(entry.published_parsed))
datetime.datetime(*entry.published_parsed[:6])


entry.published = 'Fri, 02 Jan 2015 03:04:05 +0100'
datetime.datetime.strptime(entry.published, '%a, %d %b %Y %H:%M:%S %z')


entry.updated = '2015-01-02T03:04:05'
datetime.datetime.strptime(entry.updated, '%Y-%m-%dT%H:%M:%SZ')