i have a function which as been called multiple times the problem with me if in that function i have a condition which happens only when the date changes so how to do that.I tried something like below given code but it is getting updated everytime can anyone can give a way to find how to do that
from datetime import datetime,date
import pytz
itimezone = pytz.timezone("Asia/Kolkata")
x = datetime(2021, 6, 17).date()
print(x)
y=datetime.now().date()
def f(x):
if x>y:
x=y;
print(x)
#do something
for z in range(2):
f(x)