1
0
Fork 0
mirror of https://github.com/SocksPls/hltv-api synced 2025-04-29 23:23:08 +00:00

fix(countdown): replace

This commit is contained in:
David Silva 2022-07-26 14:39:43 +02:00
parent afcc295576
commit 0edf416ec4

View file

@ -375,7 +375,7 @@ def get_match_countdown(match_id):
timeAndEvent = match_page.find("div", {"class": "timeAndEvent"})
date = timeAndEvent.find("div", {"class": "date"}).text
time = timeAndEvent.find("div", {"class": "time"}).text
dateArr = date.replace("th of","").split()
dateArr = date.replace("th of","").replace("rd of","").replace("st of","").replace("nd of","").split()
dateTextFromArrPadded = _padIfNeeded(dateArr[2]) + "-" + _padIfNeeded(_monthNameToNumber(dateArr[1])) + "-" + _padIfNeeded(dateArr[0])
dateFromHLTV = datetime.datetime.strptime(dateTextFromArrPadded,'%Y-%m-%d').replace(tzinfo=HLTV_ZONEINFO)