How to get last day of month using python
How to get last day of month using python
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajanikant HawaldarPosted Jun 14, 2020, 3:13 AM
Sagar LadPosted Aug 19, 2021, 2:47 PM
Hi Guru,
import calendar
>>> calendar.monthrange(2002, 1)
(1, 31)
>>> calendar.monthrange(2008, 2) # leap years are handled correctly
(4, 29)
Akshay ShedwadPosted Jun 14, 2020, 6:11 AM