File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,16 @@ def rss_item(title: str | None = None,
4444 item .append (ET .Element ("pubDate" ))
4545
4646 # Make sure months are processed correctly when there's some inconsistency
47- # https://docs.python.org/3/library/datetime.html#format-codes
47+ # https://docs.python.org/3/library/datetime.html#format-codes
48+ # 09:00:00 EST is set as default for simplicity
4849 if pubDate .split (' ' )[0 ] in calendar .month_name :
49- fmt_date = datetime .strptime (pubDate , "%B %d, %Y" ).strftime ("%d %b %Y" )
50+ fmt_date = (datetime
51+ .strptime (pubDate , "%B %d, %Y 09:00:00 EST" )
52+ .strftime ("%d %b %Y" ))
5053 elif pubDate .split (' ' )[0 ] in calendar .month_abbr :
51- fmt_date = datetime .strptime (pubDate , "%b %d, %Y" ).strftime ("%d %b %Y" )
54+ fmt_date = (datetime
55+ .strptime (pubDate , "%b %d, %Y 09:00:00 EST" )
56+ .strftime ("%d %b %Y" ))
5257 else :
5358 fmt_date = '01 January 1970' # Just default to UNIX start
5459 item [- 1 ].text = fmt_date
You can’t perform that action at this time.
0 commit comments