Skip to navigation
Get the date of one month back with python
06.04.21
today = datetime.date.today() first = today.replace(day=1) lastMonth = first - datetime.timedelta(days=1) year = lastMonth.strftime("%Y") month = lastMonth.strftime("%m") print(month) print(year)
https://stackoverflow.com/questions/9724906/python-date-of-the-previous-month
Reply
Anonymous
Information Epoch 1754189676
Save trees.
Home
Notebook
Contact us