Answers for "how to get previous month date from current date in python"

6

how to get the calendar of current month in python

import calendar
import datetime
month = datetime.date.today().month
year = datetime.date.today().year
print (calendar.month(year,month))
Posted by: Guest on July-09-2021
2

python datetime last day of month

>>import calendar
>>year, month = 2016, 12
>>calendar.monthrange(year, month)[1]
31
Posted by: Guest on February-08-2021

Code answers related to "how to get previous month date from current date in python"

Python Answers by Framework

Browse Popular Code Answers by Language