Stack Overflow Asked by user13788524 on November 12, 2021
from datetime import *
date = date.today()
Printing date gives me "2020-07-21"
How may I go about adding a year to that date?
Try:
import datetime as dt
d = date.today()
dt.date(d.year + 1,d.month, d.day)
Answered by ipj on November 12, 2021
from datetime import *
from dateutil.relativedelta import relativedelta
date = date.today()
newDate = date + relativedelta(years=1)
Answered by Daniel E on November 12, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP