mirror of
https://github.com/SocksPls/hltv-api
synced 2025-04-30 23:43:08 +00:00
Merge pull request #36 from SocksPls/fix-countdown-date-replace
fix(countdown): replace
This commit is contained in:
commit
1390409c08
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
@ -375,7 +375,7 @@ def get_match_countdown(match_id):
|
||||||
timeAndEvent = match_page.find("div", {"class": "timeAndEvent"})
|
timeAndEvent = match_page.find("div", {"class": "timeAndEvent"})
|
||||||
date = timeAndEvent.find("div", {"class": "date"}).text
|
date = timeAndEvent.find("div", {"class": "date"}).text
|
||||||
time = timeAndEvent.find("div", {"class": "time"}).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])
|
dateTextFromArrPadded = _padIfNeeded(dateArr[2]) + "-" + _padIfNeeded(_monthNameToNumber(dateArr[1])) + "-" + _padIfNeeded(dateArr[0])
|
||||||
|
|
||||||
dateFromHLTV = datetime.datetime.strptime(dateTextFromArrPadded,'%Y-%m-%d').replace(tzinfo=HLTV_ZONEINFO)
|
dateFromHLTV = datetime.datetime.strptime(dateTextFromArrPadded,'%Y-%m-%d').replace(tzinfo=HLTV_ZONEINFO)
|
||||||
|
|
Loading…
Add table
Reference in a new issue