One year from today, I was able to request it using the dateutil
library, but I don't know how to request the end of the month.
I would appreciate it if you could let me know if anyone knows.Thank you for your cooperation.
from datetime import datetime, date, timedelta
from dateutil.relativedelta import relativedelta
dt=date.today()+relatedelta(month=1)
(Reprinted from comments)
One year and a month later, the day before the beginning of the month,
dt=date.today()+relatedelta (years=1, months=1, day=1, days=-1)
I wonder if that's the case.
© 2024 OneMinuteCode. All rights reserved.