Generation

generate functionSat, 11 Feb 2023

calculate date in yyyy-mm-dd format for two years before from today

import datetime def date_calculator(year): today = datetime.datetime.today() end_date = today.replace(year=today.year - year) return end_date print(date_calculator(2))

Want to kickstart your project?Use the new AI Studio to create your code