I am trying the run below lines of code in a loop and want to define the timedelta as a variable as it will keep varying.
START_TIME = f"{datetime.datetime.now() - timedelta(int('%d')):%d/%m/%Y 00:00}" % COUNT
END_TIME = f"{datetime.datetime.now() - timedelta(int('%d')):%d/%m/%Y 23:59}" % COUNT
However, this is failing with below error:
ValueError: invalid literal for int() with base 10: '%d'
I am trying to get start and end time of the day for past few days and do some action over it. I tried few other ways too but did not work.