19 lines
451 B
Python
19 lines
451 B
Python
from datetime import datetime
|
|
|
|
|
|
def get_datetime(day: str) -> datetime:
|
|
"""
|
|
Takes in a string month and day and returns a datetime object of that Month/Day this year.
|
|
|
|
Args:
|
|
day (str): Month/Day in that format.
|
|
|
|
Returns:
|
|
datetime: Datetime representation of Month/Day.
|
|
"""
|
|
today = datetime.today()
|
|
month = int(day.split("/")[0])
|
|
day = int(day.split("/")[1])
|
|
|
|
return datetime(today.year, month, day)
|