@@ -1,3 +1,7 @@
|
|||||||
|
"""
|
||||||
|
File contains util functions.
|
||||||
|
"""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
@@ -11,8 +15,12 @@ def get_datetime(day: str) -> datetime:
|
|||||||
Returns:
|
Returns:
|
||||||
datetime: Datetime representation of Month/Day.
|
datetime: Datetime representation of Month/Day.
|
||||||
"""
|
"""
|
||||||
today = datetime.today()
|
year = datetime.today().year
|
||||||
month = int(day.split("/")[0])
|
month = int(day.split("/")[0])
|
||||||
day = int(day.split("/")[1])
|
day = int(day.split("/")[1])
|
||||||
|
|
||||||
return datetime(today.year, month, day)
|
# ensure that year rolls over if current month is December and the next month is less than 12.
|
||||||
|
if datetime.today().month == 12 & month < 12:
|
||||||
|
year += 1
|
||||||
|
|
||||||
|
return datetime(year, month, day)
|
||||||
|
|||||||
Reference in New Issue
Block a user