diff --git a/uk_bin_collection/uk_bin_collection/councils/BCPCouncil.py b/uk_bin_collection/uk_bin_collection/councils/BCPCouncil.py index ce6f98e417..0e1e5d4685 100644 --- a/uk_bin_collection/uk_bin_collection/councils/BCPCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/BCPCouncil.py @@ -1,4 +1,5 @@ import json +from datetime import timedelta import requests from bs4 import BeautifulSoup @@ -15,6 +16,7 @@ class CouncilClass(AbstractGetBinDataClass): """ def parse_data(self, page: str, **kwargs) -> dict: + user_uprn = kwargs.get("uprn") check_uprn(user_uprn) @@ -28,8 +30,8 @@ def parse_data(self, page: str, **kwargs) -> dict: for bin in json_data: bin_type = bin["BinType"] - next_date = datetime.strptime(bin["Next"], "%m/%d/%Y %H:%M:%S %p") - subseq_date = datetime.strptime(bin["Subsequent"], "%m/%d/%Y %H:%M:%S %p") + next_date = datetime.strptime(bin["Next"], "%m/%d/%Y %I:%M:%S %p") + timedelta(hours=1) + subseq_date = datetime.strptime(bin["Subsequent"], "%m/%d/%Y %I:%M:%S %p") + timedelta(hours=1) collections.append((bin_type, next_date)) collections.append((bin_type, subseq_date))