From dec822f8fc0a910863a4b123038a6b05fd787d4b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 20 Dec 2025 15:19:44 +0000 Subject: [PATCH] Debug --- newswire.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/newswire.py b/newswire.py index 1418b2a57..620151c72 100644 --- a/newswire.py +++ b/newswire.py @@ -12,6 +12,7 @@ import json import requests import random import time +import datetime from socket import error as SocketError import errno from datetime import timedelta @@ -354,11 +355,18 @@ def parse_feed_date(pub_date: str, unique_string_identifier: str) -> str: errmsg += ' ' + pub_date2 try: - published_date = date_from_string_format(pub_date2, [date_format]) - except BaseException: + published_date = \ + datetime.datetime.strptime(pub_date2, date_format) + # published_date = \ + # date_from_string_format(pub_date2, [date_format]) + except BaseException as exc: + errmsg += ' ' + str(exc) continue if published_date is not None: + if not published_date.tzinfo: + published_date = \ + published_date.replace(tzinfo=timezone.utc) if pub_date.endswith(' EST'): hours_added = timedelta(hours=5) published_date = published_date + hours_added