you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 1 year ago

or just this

from datetime import datetime

today = datetime.today()
ten_years_ago = today.replace(year=today.year - 10)
print("Date 10 years ago:", ten_years_ago.date())
  • source
  • parent