I am looking to get today's date and n - today's date in the format below : -
tod = datetime.datetime.now()
d = datetime.timedelta(days = 365)
x = tod - d
I want x and tod in YYYYMMDD format for eg : 20230130
How do I get it to this format