May-29-2022, 11:09 AM
Hi
can any one pls help me with convering and formating the variable timeset so my cod can work.
it works only if i replace the timeset variable with the date.
can any one pls help me with convering and formating the variable timeset so my cod can work.
it works only if i replace the timeset variable with the date.
import datetime
# to get today's date
today = datetime.date.today()
timeset = "2020, 5, 29"
# code works when i put the date of timeset variable here
thedate = datetime.date(timeset)
# to get delta in days form today (this is an absolute value)
delta = today - thedate
print(f"The delta is {delta.days} days")
if delta.days > 0:
print("dags")
elif delta.days < 365:
print("inte dags")
